Exemplo n.º 1
0
 /**
  * @return Book
  */
 public function getBook()
 {
     $book = null;
     if ($this->chapter && $this->chapter->getBook()) {
         $book = $this->chapter->getBook();
     }
     return $book;
 }
Exemplo n.º 2
0
 /**
  * Add chapters
  *
  * @param \AppBundle\Entity\Chapter $chapters
  * @return Book
  */
 public function addChapter(\AppBundle\Entity\Chapter $chapter)
 {
     $chapter->setBook($this);
     $this->chapters[] = $chapter;
     return $this;
 }
Exemplo n.º 3
0
 private function route(Chapter $chapter)
 {
     return $this->get('router')->generate('api_1_get_chapter', ['chapter' => $chapter->getId()]);
 }