Ejemplo n.º 1
0
 /**
  * @param string  $key
  * @param Channel $entity
  */
 public function fillEntityData($key, $entity)
 {
     list($name, $type) = explode('|', $key);
     $entity->setName($name);
     $entity->setChannelType($type);
     $entity->setStatus(Channel::STATUS_ACTIVE);
     $entity->setCreatedAt(new \DateTime());
     $entity->setUpdatedAt(new \DateTime());
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function load(ObjectManager $manager)
 {
     $this->em = $manager;
     $date = new \DateTime('now');
     $channel = new Channel();
     $channel->setName('some name');
     $channel->setOwner($this->loadOwner());
     $channel->setChannelType('testType');
     $channel->setCreatedAt($date);
     $channel->setUpdatedAt($date);
     $channel->setCustomerIdentity('test1');
     $channel->setEntities(['test1', 'test2']);
     $manager->persist($channel);
     $this->setReference('default_channel', $channel);
     $manager->flush();
 }