/** * Creates a CronJobDefinition from a Array $job * provided by the parser $parser * * @param Array $xml * @param CronJobParser $parser * * @return CronJobDefinition */ public static function fromArray(array $job, CronJobParser $parser) { // create and return object $obj = new self(); $obj->setParser($parser); $obj->setName($job["name"]); $obj->setForkable((bool) $job["forkable"]); $obj->setInterval($job["interval"]); $obj->setPath($job["path"]); $obj->setClass($job["class"]); $obj->setStartTime($job["starttime"]); $obj->setEndTime($job["endtime"]); $obj->setArguments($job["args"]); $obj->setWeekDays($job["weekdays"]); $obj->setSuspended((bool) $job["suspended"]); if (isset($job["lastrun"])) { $obj->setLastExec($job["lastrun"]); } else { $obj->setLastExec(0); } return $obj; }