/** * Все студенты группы. * Отсортированы по ФИО * * @return CArrayList */ public function getStudents() { if (is_null($this->_students)) { $this->_students = new CArrayList(); foreach (CActiveRecordProvider::getWithCondition(TABLE_STUDENTS, "group_id=" . $this->getId(), "fio asc")->getItems() as $item) { $student = new CStudent($item); $this->_students->add($student->getId(), $student); CStaffManager::getCacheStudents()->add($student->getId(), $student); } } return $this->_students; }