/** * @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; }
/** * {@inheritDoc} */ public function load(ObjectManager $om) { $this->organization = $this->getReference('default_organization'); $this->users = $om->getRepository('OroUserBundle:User')->findAll(); $website = new Website(); $website->setCode('admin')->setName('Admin'); $om->persist($website); $store = new Store(); $store->setCode('admin')->setName('Admin')->setWebsite($website); $om->persist($store); $transport = new MagentoSoapTransport(); $transport->setApiUser('api_user'); $transport->setApiKey('api_key'); $transport->setExtensionVersion(SoapTransport::REQUIRED_EXTENSION_VERSION); $transport->setIsExtensionInstalled(true); $transport->setMagentoVersion('1.9.1.0'); $transport->setWsdlUrl('http://magento.domain'); $om->persist($transport); $integration = new Integration(); $integration->setType('magento'); $integration->setConnectors(['customer', 'cart', 'order', 'newsletter_subscriber']); $integration->setName(self::INTEGRATION_NAME); $integration->setTransport($transport); $integration->setOrganization($this->organization); $om->persist($integration); $builder = $this->factory->createBuilderForIntegration($integration); $builder->setOwner($integration->getOrganization()); $builder->setDataSource($integration); $builder->setStatus($integration->isEnabled() ? Channel::STATUS_ACTIVE : Channel::STATUS_INACTIVE); $this->dataChannel = $builder->getChannel(); $om->persist($this->dataChannel); $group = new CustomerGroup(); $group->setName('General'); $group->setOriginId(15000); $group->setChannel($integration); $om->persist($group); $om->flush(); $this->persistDemoCustomers($om, $website, $store, $group, $integration); $om->flush(); $this->persistDemoCarts($om, $store, $integration); $om->flush(); $this->persistDemoOrders($om, $store, $integration); $om->flush(); $this->persistDemoRFM($om); $om->flush(); }