本文整理汇总了PHP中ClassGroupPeer::doSelectOne方法的典型用法代码示例。如果您正苦于以下问题:PHP ClassGroupPeer::doSelectOne方法的具体用法?PHP ClassGroupPeer::doSelectOne怎么用?PHP ClassGroupPeer::doSelectOne使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClassGroupPeer
的用法示例。
在下文中一共展示了ClassGroupPeer::doSelectOne方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: userSchoolInit
private function userSchoolInit()
{
/* Getting User School */
$schoolCriteria = new Criteria();
$schoolCriteria->add(ClassGroupPeer::DEPARTMENT_ID, $this->department->getId(), Criteria::EQUAL);
$this->school = ClassGroupPeer::doSelectOne($schoolCriteria);
/* Getting User Classes */
$classesCriteria = new Criteria();
$classesCriteria->add(ClassGroupPeer::PARENT, $this->school->getId(), Criteria::EQUAL);
$classTemp = ClassGroupPeer::doSelect($classesCriteria);
$classArray = array();
foreach ($classTemp as $temp) {
$classArray[] = $temp->getId();
}
$classesCriteria2 = new Criteria();
$classesCriteria2->add(ClassGroupPeer::PARENT, $classArray, Criteria::IN);
$classesCriteria2->addAscendingOrderByColumn(ClassGroupPeer::NAME);
$this->classes = ClassGroupPeer::doSelect($classesCriteria2);
}
示例2: getStudents
public function getStudents($classId)
{
$classCriteria = new Criteria();
$classCriteria->add(ClassGroupPeer::ID, $classId, Criteria::IN);
$class = ClassGroupPeer::doSelectOne($classCriteria);
$accal = $this->getAccal($class->getDepartmentId());
$criteria = new Criteria();
$criteria->add(StudentPeer::CLASS_GROUP_ID, $classId, Criteria::IN);
$criteria->add(StudentPeer::STUDENT_DETAIL_ID, 0, Criteria::NOT_EQUAL);
$criteria->add(StudentPeer::ACADEMIC_CALENDAR_ID, $accal->getId(), Criteria::EQUAL);
$criteria->add(StudentPeer::STATUS, 1, Criteria::EQUAL);
$criteria->addAscendingOrderByColumn(StudentPeer::NAME);
$result = StudentPeer::doSelect($criteria);
if (!$result) {
return false;
} else {
return $result;
}
}