Пример #1
0
 public function loadJobInstances(ObjectManager $manager)
 {
     $handle = fopen(__DIR__ . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'job_instance_data.csv', 'r');
     $headers = fgetcsv($handle, 1000, ',');
     while (($data = fgetcsv($handle, 1000, ',')) !== false) {
         $combined = array_combine($headers, $data);
         $jobInstanceEntity = new JobInstance();
         $jobInstanceEntity->setCode($combined['Code']);
         $jobInstanceEntity->setAlias($combined['Alias']);
         $jobInstanceEntity->setStatus($combined['Status']);
         $jobInstanceEntity->setConnector($combined['Connector']);
         $jobInstanceEntity->setType($combined['Type']);
         $manager->persist($jobInstanceEntity);
         $this->jobInstances[$combined['Id']] = $jobInstanceEntity;
     }
     fclose($handle);
 }
 /**
  * {@inheritDoc}
  */
 public function setType($type)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setType', array($type));
     return parent::setType($type);
 }