本文整理汇总了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);
}
示例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';
}
示例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';
}