23 lines
476 B
PHP
23 lines
476 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
class UsuarioWeb extends CWebUser {
|
||
|
|
|
||
|
|
private $_model;
|
||
|
|
|
||
|
|
function getId_empresa() {
|
||
|
|
$usuario = $this->loadUser(Yii::app()->user->id);
|
||
|
|
return $usuario->id_empresa;
|
||
|
|
}
|
||
|
|
|
||
|
|
// Load user model.
|
||
|
|
protected function loadUser($id = null) {
|
||
|
|
if ($this->_model === null) {
|
||
|
|
if ($id !== null)
|
||
|
|
$this->_model = Usuario::model()->findByPk($id);
|
||
|
|
}
|
||
|
|
return $this->_model;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
?>
|