|
@@ -8,12 +8,22 @@ use Yii;
|
|
|
* This is the model class for table "Usuario".
|
|
* This is the model class for table "Usuario".
|
|
|
*
|
|
*
|
|
|
* @property int $id
|
|
* @property int $id
|
|
|
- * @property string $rfc
|
|
|
|
|
|
|
+ * @property string|null $uid
|
|
|
* @property string $correo
|
|
* @property string $correo
|
|
|
- * @property string $clave
|
|
|
|
|
* @property string $nombre
|
|
* @property string $nombre
|
|
|
- * @property string $apellidoPaterno
|
|
|
|
|
- * @property int|null $estatus 0:inactivo, 1:activo
|
|
|
|
|
|
|
+ * @property int|null $idRol
|
|
|
|
|
+ * @property string|null $genero
|
|
|
|
|
+ * @property string|null $facebook
|
|
|
|
|
+ * @property bool|null $facebookVerificado
|
|
|
|
|
+ * @property string|null $twitter
|
|
|
|
|
+ * @property bool|null $twitterVerificado
|
|
|
|
|
+ * @property string|null $instagram
|
|
|
|
|
+ * @property bool|null $instagramVerificado
|
|
|
|
|
+ * @property string|null $creado
|
|
|
|
|
+ * @property string|null $modificado
|
|
|
|
|
+ * @property string|null $eliminado
|
|
|
|
|
+ *
|
|
|
|
|
+ * @property Rol $rol
|
|
|
*/
|
|
*/
|
|
|
class Usuario extends \yii\db\ActiveRecord {
|
|
class Usuario extends \yii\db\ActiveRecord {
|
|
|
|
|
|
|
@@ -32,11 +42,15 @@ class Usuario extends \yii\db\ActiveRecord {
|
|
|
*/
|
|
*/
|
|
|
public function rules() {
|
|
public function rules() {
|
|
|
return [
|
|
return [
|
|
|
- [['rfc', 'correo', 'clave', 'nombre', 'apellidoPaterno'], 'required'],
|
|
|
|
|
- [['estatus'], 'default', 'value' => null],
|
|
|
|
|
- [['estatus'], 'integer'],
|
|
|
|
|
- [['rfc'], 'string', 'max' => 13],
|
|
|
|
|
- [['correo', 'clave', 'nombre', 'apellidoPaterno'], 'string', 'max' => 100],
|
|
|
|
|
|
|
+ [['correo', 'nombre'], 'required'],
|
|
|
|
|
+ [['idRol'], 'default', 'value' => null],
|
|
|
|
|
+ [['idRol'], 'integer'],
|
|
|
|
|
+ [['facebookVerificado', 'twitterVerificado', 'instagramVerificado'], 'boolean'],
|
|
|
|
|
+ [['creado', 'modificado', 'eliminado'], 'safe'],
|
|
|
|
|
+ [['uid'], 'string', 'max' => 50],
|
|
|
|
|
+ [['correo', 'nombre', 'genero', 'facebook', 'twitter', 'instagram'], 'string', 'max' => 100],
|
|
|
|
|
+ [['uid'], 'unique'],
|
|
|
|
|
+ [['idRol'], 'exist', 'skipOnError' => true, 'targetClass' => Rol::className(), 'targetAttribute' => ['idRol' => 'id']],
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -46,13 +60,20 @@ class Usuario extends \yii\db\ActiveRecord {
|
|
|
public function attributeLabels() {
|
|
public function attributeLabels() {
|
|
|
return [
|
|
return [
|
|
|
'id' => 'ID',
|
|
'id' => 'ID',
|
|
|
- 'rfc' => 'Rfc',
|
|
|
|
|
|
|
+ 'uid' => 'Uid',
|
|
|
'correo' => 'Correo',
|
|
'correo' => 'Correo',
|
|
|
- 'clave' => 'Clave',
|
|
|
|
|
'nombre' => 'Nombre',
|
|
'nombre' => 'Nombre',
|
|
|
- 'apellidoPaterno' => 'Apellido Paterno',
|
|
|
|
|
- 'apellidoMaterno' => 'Apellido Materno',
|
|
|
|
|
- 'estatus' => 'Estatus',
|
|
|
|
|
|
|
+ 'idRol' => 'Id Rol',
|
|
|
|
|
+ 'genero' => 'Genero',
|
|
|
|
|
+ 'facebook' => 'Facebook',
|
|
|
|
|
+ 'facebookVerificado' => 'Facebook Verificado',
|
|
|
|
|
+ 'twitter' => 'Twitter',
|
|
|
|
|
+ 'twitterVerificado' => 'Twitter Verificado',
|
|
|
|
|
+ 'instagram' => 'Instagram',
|
|
|
|
|
+ 'instagramVerificado' => 'Instagram Verificado',
|
|
|
|
|
+ 'creado' => 'Creado',
|
|
|
|
|
+ 'modificado' => 'Modificado',
|
|
|
|
|
+ 'eliminado' => 'Eliminado',
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -64,4 +85,12 @@ class Usuario extends \yii\db\ActiveRecord {
|
|
|
return Yii::$app->getSecurity()->validatePassword($pwd, $this->clave);
|
|
return Yii::$app->getSecurity()->validatePassword($pwd, $this->clave);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Gets query for [[rol]].
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return \yii\db\ActiveQuery
|
|
|
|
|
+ */
|
|
|
|
|
+ public function geRol() {
|
|
|
|
|
+ return $this->hasOne(Rol::className(), ['id' => 'idRol']);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|