/** * Filter the query by a related \Models\Code object * * @param \Models\Code|ObjectCollection $code the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ChildClientQuery The current query, for fluid interface */ public function filterByCode($code, $comparison = null) { if ($code instanceof \Models\Code) { return $this->addUsingAlias(ClientTableMap::COL_CLIENT_ID, $code->getClientId(), $comparison); } elseif ($code instanceof ObjectCollection) { return $this->useCodeQuery()->filterByPrimaryKeys($code->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByCode() only accepts arguments of type \\Models\\Code or Collection'); } }