/** * Filter the query by a related Pelicula object * * @param Pelicula $pelicula the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return CategoriaQuery The current query, for fluid interface */ public function filterByPelicula($pelicula, $comparison = null) { if ($pelicula instanceof Pelicula) { return $this->addUsingAlias(CategoriaPeer::ID, $pelicula->getCategoriaId(), $comparison); } elseif ($pelicula instanceof PropelCollection) { return $this->usePeliculaQuery()->filterByPrimaryKeys($pelicula->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByPelicula() only accepts arguments of type Pelicula or PropelCollection'); } }