src/PHPDish/Bundle/PostBundle/Service/BookManager.php
public function addBookChapter(BookInterface $book, $chapter)
    {
        if (is_string($chapter)) {
            $title = $chapter;
            $chapter = $this->postManager->createPost($book->getCreator());
            $chapter->setTitle($title);
        }
        $chapter->setUpdatedAt(Carbon::now())
            ->setCategory($book);
        $this->postManager->savePost($chapter);
        return $chapter;
    }
public function addBookChapter(BookInterface $book, $chapter)
    {
        if (is_string($chapter)) {
            $title = $chapter;
            $chapter = $this->postManager->createPost($book->getCreator());
            $chapter->setTitle($title);
        }
        $chapter->setUpdatedAt(Carbon::now())
            ->setCategory($book);
        $this->postManager->savePost($chapter);
        return $chapter;
    }
{@inheritdoc}