I want to get & list all the users that belongs to the same idempresa
that the user logged in has. idempresa
is related to users in a sf_guard_profile
table and yes I have the relation declared on schema.yml
file. I think in write a method in sfGuardUserTable.class.php
but I'm not so sure it will works in others words I don't know where to touch or what to handle this. Can any point me in the right direction on this? This is the method (unfinished):
public function getUsersByCompany() {
$user = sfContext::getInstance()->getUser()->getProfile()->getIdEmpresa();
$q = $this->createQuery('g');
return $q;
}
Any advice?