Name = $categoryRecord->Name; $this->Calendars = array_map( function($calendarRecord) { $dto = new CalendarDTO(); $dto->loadRecord($calendarRecord); return $dto; }, array_filter( $calendars, function($calendarRecord) use($categoryRecord) { return $categoryRecord->ID == $calendarRecord->CategoryID; } ) ); } } ?>