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


PHP School::findById方法代码示例

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


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

示例1: __construct

 public function __construct($studentId, $identityId, $gradeId, $schoolId)
 {
     $this->studentId = $studentId;
     $this->identity = Identity::findById($identityId);
     $this->school = School::findById($schoolId);
     $this->grade = Grade::findById($gradeId);
 }
开发者ID:MatthewAry,项目名称:php-cs313,代码行数:7,代码来源:student.php

示例2: listStudents

 public function listStudents()
 {
     $schoolList = [];
     foreach (School::all() as $i) {
         $schoolList[] = $i->getValues();
     }
     $studentsAtSchool = [];
     $schoolName = '';
     if (isset($_POST['schoolID'])) {
         $studentObjects = Student::allStudentsAtSchool($_POST['schoolID']);
         $schoolName = School::findById($_POST['schoolID']);
         $schoolName = $schoolName->getValues();
         $schoolName = $schoolName['name'];
         foreach ($studentObjects as $i) {
             $studentsAtSchool[] = $i->getValues();
         }
     }
     require_once 'views/student/listStudents.php';
 }
开发者ID:MatthewAry,项目名称:php-cs313,代码行数:19,代码来源:student_controller.php

示例3: listClasses

 public function listClasses()
 {
     $start = 0;
     if (isset($_POST['rStart'])) {
         $start = $_POST['rStart'];
     }
     $number = 0;
     if (isset($_POST['rNumber'])) {
         $number = $_POST['rNumber'];
     } else {
         $number = Sclass::rowCount();
     }
     $schoolList = School::all($start, $number);
     $classesAtSchool = '';
     $schoolName = '';
     if (isset($_POST['schoolID'])) {
         $classesAtSchool = Sclass::getAllClassesAtSchool($_POST['schoolID'], $start, $number);
         $schoolName = School::findById($_POST['schoolID']);
         $schoolName = $schoolName->getValues();
         $schoolName = $schoolName['name'];
     }
     require_once 'views/class/listClasses.php';
 }
开发者ID:MatthewAry,项目名称:php-cs313,代码行数:23,代码来源:sclass_controller.php


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