/** * @return Channel */ protected function createChannel() { $channel = $this->factory->createBuilder()->setName(self::CHANNEL_NAME)->setChannelType(self::CHANNEL_TYPE)->setStatus(Channel::STATUS_ACTIVE)->setOwner($this->em->getRepository('OroOrganizationBundle:Organization')->getFirst())->getChannel(); $this->em->persist($channel); $this->em->flush(); $this->setReference('default_channel', $channel); }
/** * {@inheritDoc} */ public function load(ObjectManager $om) { $channel = $this->factory->createBuilder()->setStatus(Channel::STATUS_ACTIVE)->setEntities()->setChannelType(DefaultChannelData::B2B_CHANNEL_TYPE)->setName('B2B channel')->getChannel(); $om->persist($channel); $om->flush(); $this->addReference('default_channel', $channel); }
/** * {@inheritDoc} */ public function load(ObjectManager $om) { $builder = $this->factory->createBuilder(); $builder->setStatus(Channel::STATUS_ACTIVE); $builder->setEntities(); $builder->setChannelType('b2b'); $channel = $builder->getChannel(); $om->persist($channel); $om->flush(); $this->addReference('default_channel', $channel); }
protected function initSupportingEntities(ObjectManager $manager = null) { if ($manager) { $this->em = $manager; } $this->users = $this->em->getRepository('OroUserBundle:User')->findAll(); $this->countries = $this->em->getRepository('OroAddressBundle:Country')->findAll(); $className = ExtendHelper::buildEnumValueClassName('lead_source'); $enumRepo = $manager->getRepository($className); $this->sources = $enumRepo->findAll(); $this->channel = $this->channelBuilderFactory->createBuilder()->setChannelType(DefaultChannelData::B2B_CHANNEL_TYPE)->setStatus(Channel::STATUS_ACTIVE)->setEntities()->getChannel(); $manager->persist($this->channel); $manager->flush($this->channel); }
/** * @param EntityManager $em * @param string $name * @param \DateTime $created * * @return mixed */ protected function ensureChannelCreated(EntityManager $em, $name, \DateTime $created) { if (!isset($this->channels[$name])) { $builder = $this->factory->createBuilder(); $builder->setChannelType('custom'); $builder->setName($name); $builder->setCreatedAt($created); $channel = $builder->getChannel(); $em->persist($channel); $em->flush($channel); $this->channels[$name] = $channel; } return $this->channels[$name]; }
/** * @return Channel */ protected function createChannel() { $channel = $this->factory->createBuilder()->setName(self::CHANNEL_NAME)->setChannelType(self::CHANNEL_TYPE)->setStatus(Channel::STATUS_ACTIVE)->setOwner($this->organization)->setEntities()->getChannel(); $this->em->persist($channel); $this->em->flush(); $this->setReference('default_channel', $channel); return $this; }