Reputation: 7199
How can I call method from entity class in repository class. I had tried to do something like this, but no success.
class ProfileConnectionsListRepository extends EntityRepository
{
public function connectionUserNames($userId)
{
$connections = $this->_em
->findOneBy(array('user1Id' => $userId))
->getUser2Id();
}
}
so if this is invalid can do something like that on doctrine way without using raw queries.
Upvotes: 0
Views: 50
Reputation: 24280
You might need to get repository first.
$connections = $this->_em
->getRepository(UserEntity::class)
->findOneBy(array('user1Id' => $userId))
->getUser2Id();
Upvotes: 2