/** * Получить публикации выбранного сотрудника с учётом года * @param CPerson $key * @param CTerm $int * @return CArrayList */ public static function getPublicationsByPersonByYear(CPerson $key, CTerm $int) { $publications = new CArrayList(); foreach (CStaffManager::getPublicationsByPerson($key)->getItems() as $person) { foreach (CStaffManager::getPublicationsByYear($int)->getItems() as $year) { $persons = $person->id; $years = $year->id; if ($persons == $years) { $item = CActiveRecordProvider::getById(TABLE_PUBLICATIONS, $person->id); $publication = new CPublication($item); $publications->add($publication->getId(), $publication); self::getCachePublications()->add($publication->getId(), $publication); } } } return $publications; }