Exemplo n.º 1
0
 /**
  * Filter the query by a related \Ratings object
  *
  * @param \Ratings|ObjectCollection $ratings The related object(s) to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @throws \Propel\Runtime\Exception\PropelException
  *
  * @return ChildUserReviewsQuery The current query, for fluid interface
  */
 public function filterByRatings($ratings, $comparison = null)
 {
     if ($ratings instanceof \Ratings) {
         return $this->addUsingAlias(UserReviewsTableMap::COL_RATING, $ratings->getId(), $comparison);
     } elseif ($ratings instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(UserReviewsTableMap::COL_RATING, $ratings->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByRatings() only accepts arguments of type \\Ratings or Collection');
     }
 }