I'm working on one module based on sfGuard and I need to allow users to edit or delete records. This is how I get the users:
$id_empresa = $this->getUser()->getGuardUser()->getSfGuardUserProfile()->getIdempresa();
$this->users = Doctrine_Core::getTable('sfGuardUser')->createQuery('u')->leftJoin('u.SfGuardUserProfile p')->where('idempresa = ?', $id_empresa)->execute();
But then in the view while I'm iterating I don't know how to access to user_id
value. I checked BasesfGuardUser
but no method for get the Id exists, any advice or help?
Added the code for the view This is the code for the iteration:
<?php foreach ($users as $user): ?>
<tr>
<td><?php echo $user->getFirstName() ?></td>
<td><?php echo $user->getLastName() ?></td>
<td><?php echo $user->getEmailAddress() ?></td>
<td><?php echo $user->getUsername() ?></td>
<td><?php echo $user->getIsActive() ?></td>
<td>
<a href="<?php echo url_for('guard/users/' . $user->get('id') . '/edit') ?>" class="btn btn-success btn-mini">Editar</a>
<a href="<?php echo url_for('guard/users/' . $user->get('id')) ?>" class="btn btn-danger btn-mini">Eliminar</a>
</td>
</tr>
<?php endforeach; ?>