/** * Filter the query by a related Environment object * * @param Environment|PropelObjectCollection $environment the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return SiteQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ public function filterByEnvironment($environment, $comparison = null) { if ($environment instanceof Environment) { return $this->addUsingAlias(SitePeer::ID, $environment->getSiteid(), $comparison); } elseif ($environment instanceof PropelObjectCollection) { return $this->useEnvironmentQuery()->filterByPrimaryKeys($environment->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByEnvironment() only accepts arguments of type Environment or PropelCollection'); } }