/** * Filter the query by a related \Person object * * @param \Person|ObjectCollection $person The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @throws \Propel\Runtime\Exception\PropelException * * @return ChildCustomerQuery The current query, for fluid interface */ public function filterByPerson($person, $comparison = null) { if ($person instanceof \Person) { return $this->addUsingAlias(CustomerTableMap::COL_PERSON_ID, $person->getId(), $comparison); } elseif ($person instanceof ObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(CustomerTableMap::COL_PERSON_ID, $person->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByPerson() only accepts arguments of type \\Person or Collection'); } }
/** * Declares an association between this object and a ChildPerson object. * * @param ChildPerson $v * @return $this|\Employee The current object (for fluent API support) * @throws PropelException */ public function setPerson(ChildPerson $v = null) { if ($v === null) { $this->setPersonId(NULL); } else { $this->setPersonId($v->getId()); } $this->aPerson = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the ChildPerson object, it will not be re-added. if ($v !== null) { $v->addEmployee($this); } return $this; }
/** * Exclude object from result * * @param ChildPerson $person Object to remove from the list of results * * @return $this|ChildPersonQuery The current query, for fluid interface */ public function prune($person = null) { if ($person) { $this->addUsingAlias(PersonTableMap::COL_ID, $person->getId(), Criteria::NOT_EQUAL); } return $this; }