123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?php
- namespace app\models;
- use Yii;
- /**
- * This is the model class for table "Permiso".
- *
- * @property string $id
- * @property string|null $idModulo
- * @property string|null $nombre
- * @property string|null $descripcion
- * @property string|null $creado
- * @property string|null $modificado
- * @property string|null $eliminado
- *
- * @property Modulo $idModulo0
- * @property PermisoUsuario[] $permisoUsuarios
- */
- class Permiso extends ModeloBase {
- const PERFIL_ISTAI = 'PERUSUARIO-ASESORISTAI';
- const PERFIL_COMISIONADO = 'PERUSUARIO-COMISIONADO';
- const PERFIL_PROYECTISTA = 'PERUSUARIO-PROYECTISTA';
- const PERFIL_PONENCIA = 'PERUSUARIO-PONENCIA';
- const PERFIL_SOLICITANTE = 'PERUSUARIO-SOLICITANTE';
- const PERFIL_UNIDAD_TRANSPARENCIA = 'PERUSUARIO-UNIDADTRANSP';
- const SOLICITUD_VER_TODO = 'SOLICITUD-VERTODO';
- const SUJETO_OBLIGADO_VER_TODO = 'SOLICITUD-VER-TODO-SUJETOS';
- const RR_TURNAR_PONENCIA = 'RECURSO-TURNAR-PONENCIA';
- const RR_VER_DETALLE = 'RECURSO-VERDETALLE';
- /**
- * {@inheritdoc}
- */
- public static function tableName() {
- return 'Permiso';
- }
- /**
- * {@inheritdoc}
- */
- public function rules() {
- return [
- [['id'], 'required'],
- [['creado', 'modificado', 'eliminado'], 'safe'],
- [['id', 'idModulo'], 'string', 'max' => 50],
- [['nombre', 'descripcion'], 'string', 'max' => 100],
- [['id'], 'unique'],
- [['idModulo'], 'exist', 'skipOnError' => true, 'targetClass' => Modulo::class, 'targetAttribute' => ['idModulo' => 'id']],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels() {
- return [
- 'id' => 'ID',
- 'idModulo' => 'Id Modulo',
- 'nombre' => 'Nombre',
- 'descripcion' => 'Descripcion',
- 'creado' => 'Creado',
- 'modificado' => 'Modificado',
- 'eliminado' => 'Eliminado',
- ];
- }
- public function getModulo() {
- return $this->hasOne(Modulo::class, ['id' => 'idModulo']);
- }
- public function getPermisoUsuarios() {
- return $this->hasMany(PermisoUsuario::class, ['idPermiso' => 'id']);
- }
- }
|