/** * Filter the query by a related \Employee object * * @param \Employee|ObjectCollection $employee 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 filterByEmployee($employee, $comparison = null) { if ($employee instanceof \Employee) { return $this->addUsingAlias(PersonTableMap::COL_ID, $employee->getPersonId(), $comparison); } elseif ($employee instanceof ObjectCollection) { return $this->useEmployeeQuery()->filterByPrimaryKeys($employee->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByEmployee() only accepts arguments of type \\Employee or Collection'); } }