/** * @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(); }
/** * Filter the query by a related \CustomerFamily\Model\CustomerCustomerFamily object * * @param \CustomerFamily\Model\CustomerCustomerFamily|ObjectCollection $customerCustomerFamily the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildCustomerFamilyQuery The current query, for fluid interface */ public function filterByCustomerCustomerFamily($customerCustomerFamily, $comparison = null) { if ($customerCustomerFamily instanceof \CustomerFamily\Model\CustomerCustomerFamily) { return $this->addUsingAlias(CustomerFamilyTableMap::ID, $customerCustomerFamily->getCustomerFamilyId(), $comparison); } elseif ($customerCustomerFamily instanceof ObjectCollection) { return $this->useCustomerCustomerFamilyQuery()->filterByPrimaryKeys($customerCustomerFamily->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByCustomerCustomerFamily() only accepts arguments of type \\CustomerFamily\\Model\\CustomerCustomerFamily or Collection'); } }
/** * Exclude object from result * * @param ChildCustomerCustomerFamily $customerCustomerFamily Object to remove from the list of results * * @return ChildCustomerCustomerFamilyQuery The current query, for fluid interface */ public function prune($customerCustomerFamily = null) { if ($customerCustomerFamily) { $this->addUsingAlias(CustomerCustomerFamilyTableMap::CUSTOMER_ID, $customerCustomerFamily->getCustomerId(), Criteria::NOT_EQUAL); } return $this; }