/** * {@inheritdoc} */ public function getExportFields() { // avoid security field to be exported return array_filter(parent::getExportFields(), function ($v) { return !in_array($v, array('password', 'salt')); }); }
public function getClassMetaData() { if ($this->classMetaData) { return $this->classMetaData; } return parent::getClassMetaData(); }
/** * {@inheritdoc} */ public function getFormBuilder() { $this->formOptions = array('validation_groups' => array('edit')); if ($this->getSubject()->getId() === null) { $this->formOptions = array('validation_groups' => array('create')); } return parent::getFormBuilder(); }
/** * {@inheritdoc} */ public function getBatchActions() { $actions = parent::getBatchActions(); if ($this->hasRole('ROLE_EMAIL_ADMIN')) { $actions['send_email'] = array('label' => 'batch_action_send_email', 'translation_domain' => $this->translationDomain, 'ask_confirmation' => true); } return $actions; }
/** * {@inheritdoc} */ public function getTemplate($name) { $subject = $this->getSubject(); if ($subject instanceof ChannelFacebook && $name === 'edit') { return 'LiveBroadcastBundle:CRUD:channel_facebook_edit.html.twig'; } if ($subject instanceof ChannelYouTube && $name === 'edit') { return 'LiveBroadcastBundle:CRUD:channel_youtube_edit.html.twig'; } return parent::getTemplate($name); }
/** * @return Message */ public function getNewInstance() { /** @var Message $message */ $message = parent::getNewInstance(); if ($this->isChild()) { $admin = $this->getParent(); $id = $admin->getRequest()->get('id'); /** @var Ticket $ticket */ $ticket = $admin->getObject($id); $message->setStatus($ticket->getStatus())->setPriority($ticket->getPriority())->setUser($this->tokenStorage->getToken()->getUser())->setTicket($ticket); } return $message; }
/** * @param LiveBroadcast $broadcast */ public function preRemove($broadcast) { foreach ($broadcast->getOutputChannels() as $channel) { if ($channel instanceof ChannelYouTube) { $youTubeService = $this->getYouTubeService(); try { $youTubeService->removeLiveEvent($broadcast, $channel); } catch (\Google_Service_Exception $ex) { /** @var LoggerInterface $logger */ $logger = $this->getConfigurationPool()->getContainer()->get('logger'); $logger->warning($ex->getMessage()); } } } parent::preRemove($broadcast); }
/** * {@inheritdoc} */ public function getBatchActions() { $actions = parent::getBatchActions(); if ($this->hasRole('ROLE_POST_ADMIN')) { $actions['newsletter'] = array('label' => 'batch_action_newsletter', 'translation_domain' => $this->translationDomain, 'ask_confirmation' => true); /*$actions['facebook'] = array( 'label' => 'batch_action_facebook', 'translation_domain' => $this->translationDomain, 'ask_confirmation' => true ); $actions['newsletter_and_facebook'] = array( 'label' => 'batch_action_newsletter_and_facebook', 'translation_domain' => $this->translationDomain, 'ask_confirmation' => true );*/ } return $actions; }
/** * {@inheritdoc} */ protected function configureRoutes(RouteCollection $collection) { parent::configureRoutes($collection); $collection->add('view', $this->getRouterIdParameter() . '/view'); $collection->add('switchParent', 'switch-parent'); $collection->add('savePosition', '{block_id}/save-position', array('block_id' => null)); $collection->add('composePreview', '{block_id}/compose_preview', array('block_id' => null)); }
public function __construct($code, $class, $baseControllerName) { parent::__construct($code, $class, $baseControllerName); $this->roles = new Roles(); }
public function getDashboardActions() { $actions = parent::getDashboardActions(); unset($actions['create']); return $actions; }
/** * ForumPostAdmin constructor. * @param string $code * @param string $class * @param string $baseControllerName * @param $container */ public function __construct($code, $class, $baseControllerName, $container) { parent::__construct($code, $class, $baseControllerName); $this->container = $container; }
public function createQuery($context = 'list') { $query = parent::createQuery($context); return $query; }
/** * {@inheritdoc} */ public function getTemplate($name) { if ('list' === $name && $this->isEmbedded()) { return 'YnloAdminBundle:CRUD:base_list_embedded.html.twig'; } return parent::getTemplate($name); }