private function serializeJob(Job $job) { $data = array(); $data['id'] = $job->getId(); $data['command'] = $job->getCommand(); $data['subject'] = $job->getSubject(); $data['logs'] = $job->getLogs(); $data['parameters'] = $job->getParameters(); $data['created_at'] = $job->getCreatedAt(); $data['scheduled_at'] = $job->getScheduledAt(); $data['started_at'] = $job->getStartedAt(); $data['finished_at'] = $job->getFinishedAt(); return $data; }
<?php include_once 'boot.php'; use Scattr\Client\Model\Job; $job = new Job(); $job->setId('123'); $job->setSubject("This is a test job"); $res = $client->pushJob($job); print_r($res);