diff --git a/src/AppBundle/Entity/Author.php b/src/AppBundle/Entity/Author.php new file mode 100644 index 0000000..e603318 --- /dev/null +++ b/src/AppBundle/Entity/Author.php @@ -0,0 +1,144 @@ +id; + } + + /** + * Set firstname + * + * @param string $firstname + * + * @return Author + */ + public function setFirstname($firstname) + { + $this->firstname = $firstname; + + return $this; + } + + /** + * Get firstname + * + * @return string + */ + public function getFirstname() + { + return $this->firstname; + } + + /** + * Set lastname + * + * @param string $lastname + * + * @return Author + */ + public function setLastname($lastname) + { + $this->lastname = $lastname; + + return $this; + } + + /** + * Get lastname + * + * @return string + */ + public function getLastname() + { + return $this->lastname; + } + /** + * Constructor + */ + public function __construct() + { + $this->books = new \Doctrine\Common\Collections\ArrayCollection(); + } + + /** + * Add book + * + * @param \AppBundle\Entity\Book $book + * + * @return Author + */ + public function addBook(\AppBundle\Entity\Book $book) + { + $this->books[] = $book; + + return $this; + } + + /** + * Remove book + * + * @param \AppBundle\Entity\Book $book + */ + public function removeBook(\AppBundle\Entity\Book $book) + { + $this->books->removeElement($book); + } + + /** + * Get books + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getBooks() + { + return $this->books; + } +} diff --git a/src/AppBundle/Entity/Book.php b/src/AppBundle/Entity/Book.php new file mode 100644 index 0000000..d9bc13c --- /dev/null +++ b/src/AppBundle/Entity/Book.php @@ -0,0 +1,234 @@ +categories = new \Doctrine\Common\Collections\ArrayCollection(); + } + + /** + * Get id. + * + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * Set title. + * + * @param string $title + * + * @return Book + */ + public function setTitle($title) + { + $this->title = $title; + + return $this; + } + + /** + * Get title. + * + * @return string + */ + public function getTitle() + { + return $this->title; + } + + /** + * Set pages. + * + * @param int $pages + * + * @return Book + */ + public function setPages($pages) + { + $this->pages = $pages; + + return $this; + } + + /** + * Get pages. + * + * @return int + */ + public function getPages() + { + return $this->pages; + } + + /** + * Set publishedAt. + * + * @param \DateTime $publishedAt + * + * @return Book + */ + public function setPublishedAt($publishedAt) + { + $this->publishedAt = $publishedAt; + + return $this; + } + + /** + * Get publishedAt. + * + * @return \DateTime + */ + public function getPublishedAt() + { + return $this->publishedAt; + } + + /** + * Add category + * + * @param \AppBundle\Entity\Category $category + * + * @return Book + */ + public function addCategory(\AppBundle\Entity\Category $category) + { + $this->categories[] = $category; + + return $this; + } + + /** + * Remove category + * + * @param \AppBundle\Entity\Category $category + */ + public function removeCategory(\AppBundle\Entity\Category $category) + { + $this->categories->removeElement($category); + } + + /** + * Get categories + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getCategories() + { + return $this->categories; + } + + /** + * Set author + * + * @param \AppBundle\Entity\Author $author + * + * @return Book + */ + public function setAuthor(\AppBundle\Entity\Author $author = null) + { + $this->author = $author; + + return $this; + } + + /** + * Get author + * + * @return \AppBundle\Entity\Author + */ + public function getAuthor() + { + return $this->author; + } +} diff --git a/src/AppBundle/Entity/Category.php b/src/AppBundle/Entity/Category.php new file mode 100644 index 0000000..7dc0a22 --- /dev/null +++ b/src/AppBundle/Entity/Category.php @@ -0,0 +1,117 @@ +id; + } + + /** + * Set name + * + * @param string $name + * + * @return Category + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } + + /** + * Get name + * + * @return string + */ + public function getName() + { + return $this->name; + } + /** + * Constructor + */ + public function __construct() + { + $this->books = new \Doctrine\Common\Collections\ArrayCollection(); + } + + /** + * Add book + * + * @param \AppBundle\Entity\Book $book + * + * @return Category + */ + public function addBook(\AppBundle\Entity\Book $book) + { + $this->books[] = $book; + + return $this; + } + + /** + * Remove book + * + * @param \AppBundle\Entity\Book $book + */ + public function removeBook(\AppBundle\Entity\Book $book) + { + $this->books->removeElement($book); + } + + /** + * Get books + * + * @return \Doctrine\Common\Collections\Collection + */ + public function getBooks() + { + return $this->books; + } +} diff --git a/src/AppBundle/Repository/AuthorRepository.php b/src/AppBundle/Repository/AuthorRepository.php new file mode 100644 index 0000000..fdf7c3d --- /dev/null +++ b/src/AppBundle/Repository/AuthorRepository.php @@ -0,0 +1,13 @@ +