/** * Filter the query by a related Item object * * @param Item $item the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ItemQuery The current query, for fluid interface */ public function filterByItemRelatedById($item, $comparison = null) { if ($item instanceof Item) { return $this->addUsingAlias(ItemPeer::ID, $item->getPackageId(), $comparison); } elseif ($item instanceof PropelCollection) { return $this->useItemRelatedByIdQuery()->filterByPrimaryKeys($item->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByItemRelatedById() only accepts arguments of type Item or PropelCollection'); } }