This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace common\models; | |
use Yii; | |
use yii\base\NotSupportedException; | |
use yii\behaviors\TimestampBehavior; | |
use yii\db\ActiveRecord; | |
use yii\db\Expression; | |
use yii\web\IdentityInterface; | |
use yii\helpers\Security; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getPerfil() | |
{ | |
return $this->hasOne(Perfil::className(), ['user_id' => 'id']); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* relación get rol | |
* | |
*/ | |
public function getRol() | |
{ | |
return $this->hasOne(Rol::className(), ['id' => 'rol_id']); | |
} | |
/** | |
* get rol nombre |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getUsers() | |
{ | |
return $this->hasMany(User::className(), ['estado_id' => 'id']); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* relación get estado | |
* | |
*/ | |
public function getEstado() | |
{ | |
return $this->hasOne(Estado::className(), ['id' => 'estado_id']); | |
} | |
/** | |
* * get estado nombre |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getUsers() | |
{ | |
return $this->hasMany(User::className(), ['tipo_usuario_id' => 'id']); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getTipoUsuario() | |
{ | |
return $this->hasOne(TipoUsuario::className(), ['id' => 'tipo_usuario_id']); | |
} | |
/** | |
* get tipo usuario nombre | |
* | |
*/ | |
public function getTipoUsuarioNombre() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'generoNombre' => Yii::t('app', 'Genero'), | |
'userLink' => Yii::t('app', 'User'), | |
'perfilIdLink' => Yii::t('app', 'Perfil'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @return \yii\db\ActiveQuery | |
*/ | |
public function getGeneroNombre() | |
{ | |
return $this->genero->genero_nombre; | |
} | |
/** | |
* get lista de generos para lista desplegable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @getPerfilId | |
* | |
*/ | |
public function getPerfilId() | |
{ | |
return $this->perfil ? $this->perfil->id : 'ninguno'; | |
} | |
/** | |
* @getPerfilLink |
OlderNewer