/**
  * Filter the query by a related Moviesgenres object
  *
  * @param     Moviesgenres $moviesgenres  the related object to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return    MovieQuery The current query, for fluid interface
  */
 public function filterByMoviesgenres($moviesgenres, $comparison = null)
 {
     if ($moviesgenres instanceof Moviesgenres) {
         return $this->addUsingAlias(MoviePeer::ID, $moviesgenres->getMovieid(), $comparison);
     } elseif ($moviesgenres instanceof PropelCollection) {
         return $this->useMoviesgenresQuery()->filterByPrimaryKeys($moviesgenres->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByMoviesgenres() only accepts arguments of type Moviesgenres or PropelCollection');
     }
 }
Example #2
0
 /**
  * Associate a Movie object to this object
  * through the moviesGenres cross reference table.
  *
  * @param      Movie $movie The Moviesgenres object to relate
  * @return     void
  */
 public function addMovie($movie)
 {
     if ($this->collMovies === null) {
         $this->initMovies();
     }
     if (!$this->collMovies->contains($movie)) {
         // only add it if the **same** object is not already associated
         $moviesgenres = new Moviesgenres();
         $moviesgenres->setMovie($movie);
         $this->addMoviesgenres($moviesgenres);
         $this->collMovies[] = $movie;
     }
 }
 /**
  * Exclude object from result
  *
  * @param     Moviesgenres $moviesgenres Object to remove from the list of results
  *
  * @return    MoviesgenresQuery The current query, for fluid interface
  */
 public function prune($moviesgenres = null)
 {
     if ($moviesgenres) {
         $this->addCond('pruneCond0', $this->getAliasedColName(MoviesgenresPeer::MOVIEID), $moviesgenres->getMovieid(), Criteria::NOT_EQUAL);
         $this->addCond('pruneCond1', $this->getAliasedColName(MoviesgenresPeer::GENREID), $moviesgenres->getGenreid(), Criteria::NOT_EQUAL);
         $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
     }
     return $this;
 }