books = new \Doctrine\Common\Collections\ArrayCollection(); } /** * Get id. * * @return int */ public function getId() { return $this->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; } /** * 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; } /** * Rest: get id. * * @JMS\Serializer\Annotation\SerializedName("id") * @JMS\Serializer\Annotation\Groups({"all"}) * @JMS\Serializer\Annotation\VirtualProperty * * @return int */ public function getRestId() { return $this->getId(); } /** * Rest: get lastname. * * @JMS\Serializer\Annotation\SerializedName("lastname") * @JMS\Serializer\Annotation\Groups({"all"}) * @JMS\Serializer\Annotation\VirtualProperty * * @return string */ public function getRestLastname() { return $this->getLastname(); } /** * Rest: get firstname. * * @JMS\Serializer\Annotation\SerializedName("firstname") * @JMS\Serializer\Annotation\Groups({"all"}) * @JMS\Serializer\Annotation\VirtualProperty * * @return string */ public function getRestFirstname() { return $this->getFirstname(); } /** * Rest: get books. * * @JMS\Serializer\Annotation\SerializedName("books") * @JMS\Serializer\Annotation\Groups({"all"}) * @JMS\Serializer\Annotation\VirtualProperty * * @return ArrayCollection */ public function getRestBooks() { return $this->getBooks(); } }