/** * 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 ChildUserDetailQuery The current query, for fluid interface */ public function filterBySalesHistory($salesHistory, $comparison = null) { if ($salesHistory instanceof \ORM\SalesHistory) { return $this->addUsingAlias(UserDetailTableMap::COL_ID, $salesHistory->getUserId(), $comparison); } elseif ($salesHistory instanceof ObjectCollection) { return $this->useSalesHistoryQuery()->filterByPrimaryKeys($salesHistory->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterBySalesHistory() only accepts arguments of type \\ORM\\SalesHistory or Collection'); } }