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.
findOneBy. It should be your entity, but maybe alsoNULLif no user with the given ID was found.$this->_em->findOneBy(array('user1Id' => $userId));?$this->_em ->findOneBy(array('user1Id' => $userId))give you?