Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3925

Warning: strpos() expects parameter 1 to be string, object given when calling doctrine's getRespository() method

$
0
0

Just passing the class name to getRepository() method

/**
 * @Rest\Route("/batches", name="isbn_list_batches", methods={"GET"})
 * @Rest\QueryParam(name="page", default=1, requirements="\d+")
 * @Rest\QueryParam(name="limit", default=10, requirements="\d+")
 *
 * @param ParamFetcher $fetcher
 * @return \Pagerfanta\Pagerfanta
 */
public function listAction(ParamFetcher $fetcher)
{
    return $this
        ->em->getRepository("App:Batch")
        ->createPaginator(
            (int)$fetcher->get('page'),
            (int)$fetcher->get('limit')
        );
}

It was working and now is throwing that error. I also tried using getRepository(Batch::class)

enter image description here


Viewing all articles
Browse latest Browse all 3925

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>