private function getService()
 {
     $service = new Service();
     $service->setName('Api Service');
     $service->setUuid('61ad3d6e-4368-4784-9811-53cf0268feac');
     return $service;
 }
Beispiel #2
0
 /**
  * {@inheritdoc}
  */
 public function load(ObjectManager $manager)
 {
     $dataSets = [['name' => 'API', 'status' => Service::OPERATIONNAL, 'description' => 'Just an api', 'url' => 'http://api.localhost', 'uuid' => '4fcd899a-91da-4128-8baf-92044fafe3db', 'user' => 'user-admin'], ['name' => 'Demo Site', 'status' => Service::OUTAGE, 'description' => 'Demo website', 'url' => 'http://demo.localhost', 'uuid' => '9e231852-5343-4653-81c8-f52ee223d3d2', 'user' => 'user-admin'], ['name' => 'Sql Service', 'status' => Service::OUTAGE, 'description' => 'Mysql Service', 'url' => 'http://sql.localhost', 'uuid' => '5072b9ac-5492-48d2-8dbb-e6f5e290440c', 'user' => 'user-admin']];
     $i = 0;
     foreach ($dataSets as $data) {
         $service = new Service();
         $service->setName($data['name']);
         $service->setStatus($data['status']);
         $service->setDescription($data['description']);
         $service->setUrl($data['url']);
         $service->setUuid($data['uuid']);
         $service->setUser($this->getReference('user-admin'));
         $this->addReference(sprintf('service-%s', $i), $service);
         $manager->persist($service);
         ++$i;
     }
     $manager->flush();
 }
 private function getService()
 {
     $service = new Service();
     $service->setName('My Test Service');
     return $service;
 }