/** * @param CustomerCustomerFamilyEvent $event */ public function customerCustomerFamilyUpdate(CustomerCustomerFamilyEvent $event) { $customerCustomerFamily = CustomerCustomerFamilyQuery::create()->findOneByCustomerId($event->getCustomerId()); if ($customerCustomerFamily === null) { $customerCustomerFamily = new CustomerCustomerFamily(); $customerCustomerFamily->setCustomerId($event->getCustomerId()); } $customerCustomerFamily->setCustomerFamilyId($event->getCustomerFamilyId())->setSiret($event->getSiret())->setVat($event->getVat())->save(); }