/** * process update brand * * @param BrandUpdateEvent $event */ public function update(BrandUpdateEvent $event) { if (null !== ($brand = BrandQuery::create()->findPk($event->getBrandId()))) { $brand->setDispatcher($event->getDispatcher()); $brand->setVisible($event->getVisible())->setLogoImageId(intval($event->getLogoImageId()) == 0 ? null : $event->getLogoImageId())->setLocale($event->getLocale())->setTitle($event->getTitle())->setDescription($event->getDescription())->setChapo($event->getChapo())->setPostscriptum($event->getPostscriptum())->save(); $event->setBrand($brand); } }