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

1
ankit parmar On Best Solutions

Use EntityRepository instead of ServiceEntityRepository :

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

You have a syntax error:

$em->getRepository(PatientFeedback::class)>getRatingReviewData(...)

to:

$em->getRepository(PatientFeedback::class)->getRatingReviewData(...)

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