コード例 #1
0
ファイル: Brand.php プロジェクト: vigourouxjulien/thelia
 /**
  * Toggle Brand visibility
  *
  * @param BrandToggleVisibilityEvent $event
  * @param string $eventName
  * @param EventDispatcherInterface $dispatcher
  * @throws \Exception
  * @throws \Propel\Runtime\Exception\PropelException
  */
 public function toggleVisibility(BrandToggleVisibilityEvent $event, $eventName, EventDispatcherInterface $dispatcher)
 {
     $brand = $event->getBrand();
     $brand->setDispatcher($dispatcher)->setVisible(!$brand->getVisible())->save();
     $event->setBrand($brand);
 }
コード例 #2
0
ファイル: Brand.php プロジェクト: margery/thelia
 /**
  * Toggle Brand visibility
  *
  * @param BrandToggleVisibilityEvent $event
  */
 public function toggleVisibility(BrandToggleVisibilityEvent $event)
 {
     $brand = $event->getBrand();
     $brand->setDispatcher($event->getDispatcher())->setVisible(!$brand->getVisible())->save();
     $event->setBrand($brand);
 }