I need to create a raw query in the repository class, but i'm geting and error
class UserRepository extends EntityRepository
{
public function usertoExpirate(){
$query = 'SELECT email
FROM user
WHERE type NOT IN("deleted", "admin")
AND expiration_date < DATE_ADD(NOW(),INTERVAL -3 MONTH)';
$statement = $this->getConnection()->prepare($query);
$statement->execute();
$user_to_expirate_password = $statement->fetchAll();
return $user_to_expirate_password;
}
I'm getting this error
Undefined method 'getConnection'. The method name must start with either findBy, findOneBy or countBy!