i have entity Collab that extend from Fos\UserBundle\Model\User, i want to get the entity from the username that i login . i my controller :
echo $this->getUser();
$collab->get('collab.collaborateurservice')->findCollaborateurByUserName($this->getUser());
echo $this->getEmailCollaborateur();
in my manager i defined i method :
public function findCollaborateurByUserName ($username){
return $this->getRepository()->findOneBy(array('username'=>$username));
}
i get this exception :
FatalErrorException: Error: Call to a member function get() on a non-object in
how can get this entity??