Skip to content

Fix typo bookService by bookRepository #643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/pagination.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,17 +416,17 @@ The Controller would look like this:
namespace App\Controller\Book;

use ApiPlatform\Core\Bridge\Doctrine\Orm\Paginator;
use App\Service\Book\BookService;
use App\Repository\BookRepository;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The service doesn't need to be a repository right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but in the examples on the page it's a repository

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;

class GetBooksByFavoriteAuthorAction extends AbstractController
{
public function __invoke(Request $request, BookService $bookService): Paginator
public function __invoke(Request $request, BookRepository $bookRepository): Paginator
{
$page = (int) $request->query->get('page', 1);

return $bookService->getBooksByFavoriteAuthor($page);
return $bookRepository->getBooksByFavoriteAuthor($page);
}
}
```
Expand Down