Skip to content

Invalid method call in handler example (book module tutorial) #90

@zio-mitch

Description

@zio-mitch

Bug Report

There is an invalid call to method getBooks() on bookService (conatiner), when it should be done on repository taken from the bookService.

Q A
Version(s) 5

Summary

Wrong method call.

Current behavior

Code doesn't work because method does not exist.

How to reproduce

Follow the code until these lines:

    public function getCollection(ServerRequestInterface $request): ResponseInterface
    {
        # FIXME should be bookService->getRepository()->getBooks();
        $books = $this->bookService->getBooks($request->getQueryParams());

        return $this->createResponse($request, $books);
    }

Expected behavior

Code works because method exists

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions