Reputation: 17
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?
Upvotes: 0
Views: 497
Reputation: 1879
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
Upvotes: 2
Reputation: 21
Use EntityRepository instead of ServiceEntityRepository :
use Doctrine\ORM\EntityRepository;
class UsersRepository extends EntityRepository
Upvotes: -1