ActionScheduler_NullAction

Null object implementation of an action. It represents a missing or invalid action record and is returned by data stores when an action cannot be loaded.

Source: classes/actions/ActionScheduler_NullAction.php

Class Hierarchy

ActionScheduler_Action
└── ActionScheduler_NullAction

Constructor

__construct( string $hook = '', array $args = array(), ?ActionScheduler_Schedule $schedule = null )

The constructor intentionally ignores its arguments and sets the schedule to ActionScheduler_NullSchedule:

  • set_schedule( new ActionScheduler_NullSchedule() )

No hook, args, or group are set. This is consistent with its role as a null object.

Methods

public function execute()

Overrides the base implementation and performs no work. Null actions never execute hooks.

Usage Notes

Data stores return a null action when a fetch fails or the stored record is invalid. Examples include:

  • ActionScheduler_DBStore::fetch_action() returns ActionScheduler_NullAction if the database record is missing or invalid.
  • ActionScheduler_wpPostStore::fetch_action() returns ActionScheduler_NullAction if the post record is missing or invalid.
  • ActionScheduler_HybridStore uses ActionScheduler_NullAction as a sentinel during migration and validation.