/** * @param Channel $channel */ protected function handleRequestChannelType(Channel &$channel) { if ($channel->getChannelType()) { return; } $channelType = $this->request->get(sprintf('%s[channelType]', ChannelType::NAME), null, true); if (!$channelType) { return; } $channel->setChannelType($channelType); }
/** * @param EntityManager $em * @param SettingsProvider $settingsProvider * @param Channel $channel */ public function __construct(EntityManager $em, SettingsProvider $settingsProvider, Channel $channel) { $this->em = $em; $this->settingsProvider = $settingsProvider; $this->channel = $channel; $this->channelType = $channel->getChannelType(); $this->dataSource = $channel->getDataSource(); $this->name = $channel->getName(); $this->owner = $channel->getOwner(); $this->entities = $channel->getEntities(); $this->status = (bool) $channel->getStatus(); }
/** * @param Channel $channel */ protected function validateIntegration(Channel $channel) { $errorLabel = 'orocrm.channel.form.integration_invalid.label'; $field = 'dataSource'; $integrationType = $this->provider->getIntegrationType($channel->getChannelType()); if (!empty($integrationType)) { $integration = $channel->getDataSource(); if (empty($integration)) { $this->context->addViolationAt($field, $errorLabel); } } }