コード例 #1
0
 /**
  * Filter the query by a related Categoria object
  *
  * @param     Categoria|PropelCollection $categoria The related object(s) to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return    PeliculaQuery The current query, for fluid interface
  */
 public function filterByCategoria($categoria, $comparison = null)
 {
     if ($categoria instanceof Categoria) {
         return $this->addUsingAlias(PeliculaPeer::CATEGORIA_ID, $categoria->getId(), $comparison);
     } elseif ($categoria instanceof PropelCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(PeliculaPeer::CATEGORIA_ID, $categoria->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByCategoria() only accepts arguments of type Categoria or PropelCollection');
     }
 }