private function getSubject() { if (!isset($this->subject)) { $subject_id = $this->get('subject_id'); $subjectLoader = new Subject(); $this->subject = $subjectLoader->getTree()->get($subject_id); if (!$this->subject instanceof \APP\Module\Subject\Node) { throw new RuntimeException('不正确的科目id'); } } return $this->subject; }