diff --git a/src/MovieBundle/Entity/Movie.php b/src/MovieBundle/Entity/Movie.php new file mode 100644 index 0000000000..b0f4fdf0bf --- /dev/null +++ b/src/MovieBundle/Entity/Movie.php @@ -0,0 +1,161 @@ +id; + } + + /** + * @param mixed $id + */ + public function setId($id) + { + $this->id = $id; + } + + /** + * @return mixed + */ + public function getTitle() + { + return $this->title; + } + + /** + * @param mixed $title + */ + public function setTitle($title) + { + $this->title = $title; + } + + /** + * @return mixed + */ + public function getImdbLink() + { + return $this->imdbLink; + } + + /** + * @param mixed $imdbLink + */ + public function setImdbLink($imdbLink) + { + $this->imdbLink = $imdbLink; + } + + /** + * @return mixed + */ + public function getYoutubeLink() + { + return $this->youtubeLink; + } + + /** + * @param mixed $youtubeLink + */ + public function setYoutubeLink($youtubeLink) + { + $this->youtubeLink = $youtubeLink; + } + + /** + * @return mixed + */ + public function getDescription() + { + return $this->description; + } + + /** + * @param mixed $description + */ + public function setDescription($description) + { + $this->description = $description; + } + + /** + * @return mixed + */ + public function getRating() + { + return $this->rating; + } + + /** + * @param mixed $rating + */ + public function setRating($rating) + { + $this->rating = $rating; + } + + /** + * @return mixed + */ + public function getProducer() + { + return $this->producer; + } + + /** + * @param mixed $producer + */ + public function setProducer($producer) + { + $this->producer = $producer; + } + + /** + * @return mixed + */ + public function getActors() + { + return $this->actors; + } + + /** + * @param mixed $actors + */ + public function setActors($actors) + { + $this->actors = $actors; + } + + /** + * @return mixed + */ + public function getDirector() + { + return $this->director; + } + + /** + * @param mixed $director + */ + public function setDirector($director) + { + $this->director = $director; + } + + +} \ No newline at end of file diff --git a/src/MovieBundle/Entity/Person.php b/src/MovieBundle/Entity/Person.php new file mode 100644 index 0000000000..39a00e8972 --- /dev/null +++ b/src/MovieBundle/Entity/Person.php @@ -0,0 +1,76 @@ +id; + } + + /** + * @param mixed $id + */ + public function setId($id) + { + $this->id = $id; + } + + /** + * @return mixed + */ + public function getName() + { + return $this->name; + } + + /** + * @param mixed $name + */ + public function setName($name) + { + $this->name = $name; + } + + /** + * @return mixed + */ + public function getMovies() + { + return $this->movies; + } + + /** + * @param mixed $movies + */ + public function setMovies($movies) + { + $this->movies = $movies; + } + + /** + * @return mixed + */ + public function getMoviesDirected() + { + return $this->moviesDirected; + } + + /** + * @param mixed $moviesDirected + */ + public function setMoviesDirected($moviesDirected) + { + $this->moviesDirected = $moviesDirected; + } + + +} \ No newline at end of file diff --git a/src/MovieBundle/Entity/Producer.php b/src/MovieBundle/Entity/Producer.php new file mode 100644 index 0000000000..c697546b50 --- /dev/null +++ b/src/MovieBundle/Entity/Producer.php @@ -0,0 +1,59 @@ +id; + } + + /** + * @param mixed $id + */ + public function setId($id) + { + $this->id = $id; + } + + /** + * @return mixed + */ + public function getName() + { + return $this->name; + } + + /** + * @param mixed $name + */ + public function setName($name) + { + $this->name = $name; + } + + /** + * @return mixed + */ + public function getMovies() + { + return $this->movies; + } + + /** + * @param mixed $movies + */ + public function setMovies($movies) + { + $this->movies = $movies; + } + + +} \ No newline at end of file diff --git a/src/MovieBundle/Resources/config/doctrine/Movie.orm.yml b/src/MovieBundle/Resources/config/doctrine/Movie.orm.yml new file mode 100644 index 0000000000..53594d1023 --- /dev/null +++ b/src/MovieBundle/Resources/config/doctrine/Movie.orm.yml @@ -0,0 +1,53 @@ +MovieBundle\Entity\Movie: + type: entity + table: movie + id: + id: + type: integer + generator: + strategy: AUTO + fields: + title: + type: string + length: 255 + column: title + imdbLink: + type: string + length: 255 + column: imdb_link + youtubeLink: + type: string + length: 255 + column: youtube_link + description: + type: string + length: 1024 + column: description + rating: + type: float + column: rating + + manyToOne: + producer: + targetEntity: Producer + joinColumn: + name: producer_id + referencedColumnName: id + director: + targetEntity: Person + joinColumn: + name: director_id + referencedColumnName: id + + manyToMany: + actors: + targetEntity: Person + inversedBy: movies + joinTable: + name: persons_movies + joinColumns: + person_id: + referencedColumnName: id + inverseJoinColumns: + movie_id: + referencedColumnName: id diff --git a/src/MovieBundle/Resources/config/doctrine/Person.orm.yml b/src/MovieBundle/Resources/config/doctrine/Person.orm.yml new file mode 100644 index 0000000000..285ad55554 --- /dev/null +++ b/src/MovieBundle/Resources/config/doctrine/Person.orm.yml @@ -0,0 +1,23 @@ +MovieBundle\Entity\Person: + type: entity + table: person + id: + id: + type: integer + generator: + strategy: AUTO + fields: + name: + type: string + length: 255 + column: name + + manyToMany: + movies: + targetEntity: Movie + mappedBy: actors + + oneToMany: + moviesDirected: + targetEntity: Movie + mappedBy: director \ No newline at end of file diff --git a/src/MovieBundle/Resources/config/doctrine/Producer.orm.yml b/src/MovieBundle/Resources/config/doctrine/Producer.orm.yml new file mode 100644 index 0000000000..95028bf544 --- /dev/null +++ b/src/MovieBundle/Resources/config/doctrine/Producer.orm.yml @@ -0,0 +1,18 @@ +MovieBundle\Entity\Producer: + type: entity + table: producer + id: + id: + type: integer + generator: + strategy: AUTO + fields: + name: + type: string + length: 255 + column: name + + oneToMany: + movies: + targetEntity: Movie + mappedBy: actors \ No newline at end of file