public function update(CategoryUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        if (null !== $category = CategoryQuery::create()->findPk($event->getCategoryId())) {
            $category
                ->setDispatcher($dispatcher)
                ->setDefaultTemplateId($event->getDefaultTemplateId() == 0 ? null : $event->getDefaultTemplateId())
                ->setLocale($event->getLocale())
                ->setTitle($event->getTitle())
                ->setDescription($event->getDescription())
                ->setChapo($event->getChapo())
                ->setPostscriptum($event->getPostscriptum())

                ->setParent($event->getParent())
                ->setVisible($event->getVisible())

                ->save();

            $event->setCategory($category);
        }
    }
public function update(CategoryUpdateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        if (null !== $category = CategoryQuery::create()->findPk($event->getCategoryId())) {
            $category
                ->setDispatcher($dispatcher)
                ->setDefaultTemplateId($event->getDefaultTemplateId() == 0 ? null : $event->getDefaultTemplateId())
                ->setLocale($event->getLocale())
                ->setTitle($event->getTitle())
                ->setDescription($event->getDescription())
                ->setChapo($event->getChapo())
                ->setPostscriptum($event->getPostscriptum())

                ->setParent($event->getParent())
                ->setVisible($event->getVisible())

                ->save();

            $event->setCategory($category);
        }
    }
public function update ( CategoryUpdateEvent $ event , $ eventName , EventDispatcherInterface $ dispatcher ) { if ( null !== $ category = CategoryQuery :: create ( ) -> findPk ( $ event -> getCategoryId ( ) ) ) { $ category -> setDispatcher ( $ dispatcher ) -> setDefaultTemplateId ( $ event -> getDefaultTemplateId ( ) == 0 ? null : $ event -> getDefaultTemplateId ( ) ) -> setLocale ( $ event -> getLocale ( ) ) -> setTitle ( $ event -> getTitle ( ) ) -> setDescription ( $ event -> getDescription ( ) ) -> setChapo ( $ event -> getChapo ( ) ) -> setPostscriptum ( $ event -> getPostscriptum ( ) ) -> setParent ( $ event -> getParent ( ) ) -> setVisible ( $ event -> getVisible ( ) ) -> save ( ) ; $ event -> setCategory ( $ category ) ; } }
Change a category

@param \Thelia\Core\Event\Category\CategoryUpdateEvent $event
@param $eventName
@param EventDispatcherInterface $dispatcher
Change a category