I am calling repository function with following detail

$ratingData = $em->getRepository(PatientFeedback::class)->getRatingReviewData($doctorId, $this->timezone);

and my repository class is like:

namespace App\Repository;

class PatientFeedbackRepository extends ServiceEntityRepository

getting error like:

Attempted to call function \"getRatingReviewData\" from namespace \"Api\\Controller\".

is anything specific I am missing to use entity repository?

2 Answers

ankit parmar On Best Solutions

Use EntityRepository instead of ServiceEntityRepository :

    use Doctrine\ORM\EntityRepository;
    class UsersRepository extends EntityRepository
G1.3 On

You have a syntax error:




Without the -, it's looking for a function nammed getRatingReviewData in the current namespace