/** * Filter the query by a related \CreditAccount\Model\Thelia\Model\Customer object * * @param \CreditAccount\Model\Thelia\Model\Customer|ObjectCollection $customer The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildCreditAccountQuery The current query, for fluid interface */ public function filterByCustomer($customer, $comparison = null) { if ($customer instanceof \CreditAccount\Model\Thelia\Model\Customer) { return $this->addUsingAlias(CreditAccountTableMap::CUSTOMER_ID, $customer->getId(), $comparison); } elseif ($customer instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(CreditAccountTableMap::CUSTOMER_ID, $customer->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByCustomer() only accepts arguments of type \\CreditAccount\\Model\\Thelia\\Model\\Customer or Collection'); } }
/** * Declares an association between this object and a ChildCustomer object. * * @param ChildCustomer $v * @return \CreditAccount\Model\CreditAccount The current object (for fluent API support) * @throws PropelException */ public function setCustomer(ChildCustomer $v = null) { if ($v === null) { $this->setCustomerId(NULL); } else { $this->setCustomerId($v->getId()); } $this->aCustomer = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildCustomer object, it will not be re-added. if ($v !== null) { $v->addCreditAccount($this); } return $this; }