ActionScheduler_Action{}
Class ActionScheduler_Action
Hooks from the class
Usage
$ActionScheduler_Action = new ActionScheduler_Action(); // use class methods
Methods
- public __construct( $hook, array $args = array(), ActionScheduler_Schedule $schedule = NULL, $group = '' )
- public execute()
- public get_args()
- public get_group()
- public get_hook()
- public get_schedule()
- public is_finished()
- protected set_args( array $args )
- protected set_group( $group )
- protected set_hook( $hook )
- protected set_schedule( ActionScheduler_Schedule $schedule )
ActionScheduler_Action{} ActionScheduler Action{} code WC 7.3.0
class ActionScheduler_Action { protected $hook = ''; protected $args = array(); /** @var ActionScheduler_Schedule */ protected $schedule = NULL; protected $group = ''; public function __construct( $hook, array $args = array(), ActionScheduler_Schedule $schedule = NULL, $group = '' ) { $schedule = empty( $schedule ) ? new ActionScheduler_NullSchedule() : $schedule; $this->set_hook($hook); $this->set_schedule($schedule); $this->set_args($args); $this->set_group($group); } public function execute() { return do_action_ref_array( $this->get_hook(), array_values( $this->get_args() ) ); } /** * @param string $hook */ protected function set_hook( $hook ) { $this->hook = $hook; } public function get_hook() { return $this->hook; } protected function set_schedule( ActionScheduler_Schedule $schedule ) { $this->schedule = $schedule; } /** * @return ActionScheduler_Schedule */ public function get_schedule() { return $this->schedule; } protected function set_args( array $args ) { $this->args = $args; } public function get_args() { return $this->args; } /** * @param string $group */ protected function set_group( $group ) { $this->group = $group; } /** * @return string */ public function get_group() { return $this->group; } /** * @return bool If the action has been finished */ public function is_finished() { return FALSE; } }