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