/**
  * {@inheritdoc}
  */
 public function onChannelSucceedSave(ChannelSaveEvent $event)
 {
     $channel = $event->getChannel();
     if ($channel->getChannelType() === ChannelType::TYPE && $channel->getDataSource()->getTransport() instanceof ZohoRestTransport) {
         $this->transportEntity = $channel->getDataSource()->getTransport();
         parent::onChannelSucceedSave($event);
     }
 }
Ejemplo n.º 2
0
 /**
  * @param ChannelSaveEvent $event
  */
 public function onChannelSucceedSave(ChannelSaveEvent $event)
 {
     /** @var Channel $channel */
     $channel = $event->getChannel();
     $dataSource = $channel->getDataSource();
     if ($dataSource instanceof Integration) {
         $entities = $channel->getEntities();
         $connectors = $this->getConnectors($entities);
         $dataSource->setConnectors($connectors);
         $dataSource->setEnabled(Channel::STATUS_ACTIVE === $channel->getStatus());
         $dataSource->setEditMode(Integration::EDIT_MODE_DISALLOW);
         $this->getManager()->persist($dataSource);
         $this->getManager()->flush();
     }
 }
Ejemplo n.º 3
0
 public function testGetter()
 {
     $channel = $this->getMock('OroCRM\\Bundle\\ChannelBundle\\Entity\\Channel');
     $event = new ChannelSaveEvent($channel);
     $this->assertSame($channel, $event->getChannel());
 }