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