当前位置: 首页>>代码示例>>PHP>>正文


PHP Student::className方法代码示例

本文整理汇总了PHP中app\models\Student::className方法的典型用法代码示例。如果您正苦于以下问题:PHP Student::className方法的具体用法?PHP Student::className怎么用?PHP Student::className使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\models\Student的用法示例。


在下文中一共展示了Student::className方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionToggle

 /**
  * Toggles a binary field from the summary grid
  * @param type $id
  * @param type $attribute
  * @return mixed ajax response
  * @throws ForbiddenHttpException
  */
 public function actionToggle($id, $attribute)
 {
     $accessParams = ['student' => Student::findOne($id)];
     if (Yii::$app->user->can('updateStudent', $accessParams)) {
         $action = new ToggleAction('toggle', $this, ['modelClass' => Student::className()]);
         return $action->run($id, $attribute);
     } else {
         throw new ForbiddenHttpException(Yii::t('app', 'You are not authorized to perform this action.'));
     }
 }
开发者ID:NewPaltzKarateAcademy,项目名称:KIMS,代码行数:17,代码来源:StudentController.php

示例2: getStudents

 /**
  * @return \yii\db\ActiveQuery
  */
 public function getStudents()
 {
     return $this->hasMany(Student::className(), ['school_id' => 'id']);
 }
开发者ID:NewPaltzKarateAcademy,项目名称:KIMS,代码行数:7,代码来源:School.php

示例3: getStudent

 /**
  * @return \yii\db\ActiveQuery
  */
 public function getStudent()
 {
     return $this->hasOne(Student::className(), ['id' => 'student_id']);
 }
开发者ID:NewPaltzKarateAcademy,项目名称:KIMS,代码行数:7,代码来源:StudentPhone.php

示例4: getStudents

 public function getStudents()
 {
     return $this->hasMany(Student::className(), ['id' => 'student_id'])->viaTable('teacher_student', ['teacher_id' => 'id']);
 }
开发者ID:kmarenov,项目名称:yii2-app-test,代码行数:4,代码来源:Teacher.php

示例5: getStudents

 /**
  * @return \yii\db\ActiveQuery
  */
 public function getStudents()
 {
     return $this->hasMany(Student::className(), ['id' => 'student_id'])->via('assignedRanks');
 }
开发者ID:NewPaltzKarateAcademy,项目名称:KIMS,代码行数:7,代码来源:Rank.php

示例6: getUserStudent

 public function getUserStudent()
 {
     return $this->hasOne(Student::className(), ['st_id' => 'usr_type_id']);
 }
开发者ID:AtaBashir,项目名称:ams,代码行数:4,代码来源:UserStudent.php

示例7: rules

 /**
  * @inheritdoc
  */
 public function rules()
 {
     return [[['student_id', 'teacher_id'], 'required'], [['student_id', 'teacher_id'], 'integer'], ['student_id', 'exist', 'targetClass' => Student::className(), 'targetAttribute' => 'id', 'message' => 'Ученик с таким id не найден'], ['teacher_id', 'exist', 'targetClass' => Teacher::className(), 'targetAttribute' => 'id', 'message' => 'Учитель с таким id не найден']];
 }
开发者ID:Olga--Trushina,项目名称:teachers,代码行数:7,代码来源:StudentTeacher.php


注:本文中的app\models\Student::className方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。