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