public function rules(){
     return [
         [['name','domain','mobile','email','password','description'],'required'],
         [['name','domain','contact','email'], 'trim'],
         ['address' , 'safe'],
         ['email','email'],
         [['mobile','contact'] ,'number'],
         ['image', 'image'],
         ['email','unique','targetClass' => Users::className(), 'targetAttribute' => 'email']
     ];
 }
Exemplo n.º 2
0
 public function getUser(){
     return $this->hasOne(Users::className(),['id' => 'user'])->viaTable(CompanyUsers::tableName(),['company' => 'id']);
 }
Exemplo n.º 3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getUser0()
 {
     return $this->hasOne(Users::className(), ['id' => 'user']);
 }
Exemplo n.º 4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getUsers()
 {
     return $this->hasMany(Users::className(), ['user_role' => 'id']);
 }