Beispiel #1
0
 public function actionValidate($id = '')
 {
     Yii::$app->response->format = Response::FORMAT_JSON;
     if (!Yii::$app->request->isAjax) {
         return false;
     }
     $model = null;
     if (empty($id)) {
         $model = static::getIdentityNewModel(IM::className());
     } else {
         $model = IM::findByIdentity()->id($id)->one();
     }
     if (!$model) {
         return false;
     }
     /* @var $model IM */
     $model->scenario = IM::SCENARIO_FORM;
     if ($model->load(Yii::$app->request->post())) {
         return ActiveForm::validate($model);
     }
     return false;
 }
Beispiel #2
0
 /**
  * Get list of contacts.
  */
 public function actionList()
 {
     return static::getList(IM::className());
 }
Beispiel #3
0
 /**
  * @return BaseUserItemQuery
  */
 public function getIms()
 {
     $model = IM::buildNoInitModel();
     return $this->hasMany(IM::className(), [$model->createdByAttribute => $this->guidAttribute])->inverseOf('user');
 }