/** * Filter the query by a related \Customer object * * @param \Customer|ObjectCollection $customer the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildPersonQuery The current query, for fluid interface */ public function filterByCustomer($customer, $comparison = null) { if ($customer instanceof \Customer) { return $this->addUsingAlias(PersonTableMap::COL_ID, $customer->getPersonId(), $comparison); } elseif ($customer instanceof ObjectCollection) { return $this->useCustomerQuery()->filterByPrimaryKeys($customer->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByCustomer() only accepts arguments of type \\Customer or Collection'); } }