Exemplo n.º 1
0
 /**
  * Load data to database.
  *
  * @param ObjectManager $em Doctrine entity manager
  */
 public function load(ObjectManager $em)
 {
     $registry = new Registry();
     $registry->setCode('hebergeur');
     $registry->setName('Registre des hébergeurs');
     $em->persist($registry);
     $this->addReference('registre-hebergeur', $registry);
     $registry = new Registry();
     $registry->setCode('fondateur');
     $registry->setName('Registre des fondateurs');
     $em->persist($registry);
     $this->addReference('registre-fondateur', $registry);
     $registry = new Registry();
     $registry->setCode('administrateur');
     $registry->setName('Registre des administrateurs');
     $em->persist($registry);
     $this->addReference('registre-administrateur', $registry);
     $registry = new Registry();
     $registry->setCode('moderateur');
     $registry->setName('Registre des moderateurs');
     $em->persist($registry);
     $this->addReference('registre-moderateur', $registry);
     $registry = new Registry();
     $registry->setCode('community-manager');
     $registry->setName('Registre des community managers');
     $em->persist($registry);
     $this->addReference('registre-community-manager', $registry);
     $em->flush();
 }
Exemplo n.º 2
0
 /**
  * Remove registry.
  *
  * @param Registry $registry
  */
 public function removeRegistry(Registry $registry)
 {
     //AT - Do not remove the next line.
     $registry->removeLog($this);
     // synchronously updating inverse side
     $this->registries->removeElement($registry);
 }
Exemplo n.º 3
0
 /**
  * Tests Registry->__toString().
  */
 public function testToString()
 {
     $this->registry->setCode('foo');
     $this->registry->setName('bar');
     $this->assertEquals('bar', $this->registry->__toString());
 }
Exemplo n.º 4
0
 /**
  * Return Code from a given Repository.
  *
  * @param Registry|string $registry Parent registry
  *
  * @return string code of the registry
  */
 private function getCodeOfRegistry($registry)
 {
     if ($registry instanceof Registry) {
         return $registry->getCode();
     }
     return $registry;
 }
Exemplo n.º 5
0
 /**
  * Test private method getLogOfRepository.
  */
 public function testGetLogOfRepository()
 {
     $expected = 'foo';
     $actual = $this->invokeMethod($this->logRepository, 'getCodeOfRegistry', array('foo'));
     $this->assertEquals($expected, $actual);
     $expected = 'bar';
     $registry = new Registry();
     $registry->setCode('bar');
     $actual = $this->invokeMethod($this->logRepository, 'getCodeOfRegistry', array($registry));
     $this->assertEquals($expected, $actual);
 }