Exemplo n.º 1
0
 public function loadJobExecutions(ObjectManager $manager)
 {
     $handle = fopen(__DIR__ . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'job_execution_data.csv', 'r');
     $headers = fgetcsv($handle, 1000, ',');
     while (($data = fgetcsv($handle, 1000, ',')) !== false) {
         $combined = array_combine($headers, $data);
         $createTime = new \DateTime('now', new \DateTimeZone('UTC'));
         $createTime->sub(\DateInterval::createFromDateString($combined['Create Time']));
         $jobExecutionEntity = new JobExecution();
         $jobExecutionEntity->setJobInstance($this->jobInstances[$combined['Job Instance']]);
         $jobExecutionEntity->setCreateTime($createTime);
         $jobExecutionEntity->setStatus(new BatchStatus($combined['Status']));
         $jobExecutionEntity->setPid($combined['Pid']);
         $manager->persist($jobExecutionEntity);
     }
     fclose($handle);
 }
 /**
  * {@inheritDoc}
  */
 public function setCreateTime(\DateTime $createTime)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setCreateTime', array($createTime));
     return parent::setCreateTime($createTime);
 }