示例#1
0
 /**
  * Associate a Movie object to this object
  * through the moviesPersons cross reference table.
  *
  * @param      Movie $movie The Moviespersons 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
         $moviespersons = new Moviespersons();
         $moviespersons->setMovie($movie);
         $this->addMoviespersons($moviespersons);
         $this->collMovies[] = $movie;
     }
 }