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

Undefined method 'getCategories'. The method name must start with either findBy, findOneBy or countBy

$
0
0

In Categories enity, there're annotations:

* @ORM\Entity(repositoryClass="App\Repository\CategoriesRepository")* @ORM\Entity(repositoryClass="Gedmo\Tree\Entity\Repository\NestedTreeRepository")

In CategoriesRepository, there is:

namespace App\Repository;use App\SomeRepository;class CategoriesRepository extends SomeRepository{      public function getCategories($id,...)}

In the CategoriesController, there is:

namespace App\Controller;public function indexAction(Request $request, $id, ...){     $categoriesRepository = $this->em->getRepository('App:Categories');     $list = $categoriesRepository->getCategories($id,...);}

Why is there an error and how to fix it?


Viewing all articles
Browse latest Browse all 3916

Trending Articles



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