.

CreateSchedulerBaseCommand Class Reference

Overload create command, to respect excusive paramter. More...

Inheritance diagram for CreateSchedulerBaseCommand:
CommandChain CommandBase ICommand IAction ISerializable CreateSchedulerCommand

List of all members.

Protected Member Functions

  check_exclusive ($params, $created)
  If exclusive, delate old.
  create_scheduler ($params, &$created)
  Create the Scheduler Task.
  do_execute ()
  validate_params ($params)
  Check params, makes action relative.

Detailed Description

Overload create command, to respect excusive paramter.

Definition at line 5 of file createscheduler.cmd.php.


Member Function Documentation

CreateSchedulerBaseCommand::check_exclusive ( params,
created  
) [protected]

If exclusive, delate old.

Returns:
Status

Definition at line 54 of file createscheduler.cmd.php.

00054                                                               {
00055                 $ret = new Status();
00056                 if (Arr::get_item($params, 'exclusive', false)) {
00057                         $scheduler = new DAOScheduler();
00058                         $scheduler->add_where('action', '=', $created->action);
00059                         $scheduler->add_where('scheduledate', '<', $created->scheduledate);
00060                         $scheduler->add_where('status', '!=', Scheduler::STATUS_PROCESSING);
00061                         $ret->merge($scheduler->delete(DAOScheduler::WHERE_ONLY));
00062                 }
00063                 return $ret;
00064         }
CreateSchedulerBaseCommand::create_scheduler ( params,
&$  created  
) [protected]

Create the Scheduler Task.

Returns:
Status

Definition at line 38 of file createscheduler.cmd.php.

00038                                                                 {
00039                 Load::commands('generics/create');
00040                 $cmd = new CreateCommand('scheduler', $params);
00041                 $ret = $cmd->execute();
00042                 if ($ret->is_ok()) {
00043                         $created = $cmd->get_result();
00044                         $this->set_result($created);
00045                 }
00046                 return $ret;            
00047         }
CreateSchedulerBaseCommand::do_execute (  )  [protected]

Reimplemented from CommandChain.

Definition at line 6 of file createscheduler.cmd.php.

00006                                         {
00007                 $ret = new Status();
00008                 $params = $this->validate_params($this->get_params());
00009                 
00010                 //Create the Sourcedomain
00011                 $created = false;
00012                 $ret->merge($this->create_scheduler($params, $created));
00013                 if ($ret->is_ok()) {
00014                         $ret->merge($this->check_exclusive($params, $created));
00015                 }
00016                 return $ret;
00017         }
CreateSchedulerBaseCommand::validate_params ( params  )  [protected]

Check params, makes action relative.

Definition at line 22 of file createscheduler.cmd.php.

00022                                                     {
00023                 $action = Arr::get_item($params, 'action', '');
00024                 if (strpos($action, '://') !== false) {
00025                         $url = Url::create($action);
00026                         if ($url->is_valid()) {
00027                                 $params['action'] = $url->get_path();
00028                         }
00029                 }       
00030                 return $params; 
00031         } 

The documentation for this class was generated from the following file: