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