groupsInternal(); foreach ($groups as $group) { foreach ($group->entries as $entry) { if ($entry->id === $this->selectedId) { $entry->selected = 'selected'; } } } return $groups; } public function setSelected($id) { $this->selectedId = $id; } } class HookEntryGroup { /** * @var string */ public $groupName; /** * @var HookEntry[] */ public $entries; public function __construct($groupName, $entries) { $this->groupName = $groupName; $this->entries = $entries; } } class HookEntry { /** * @var string */ public $id; /** * @var string */ public $name; /** * @var string internal - to be set by ipxe module */ public $selected; public function __construct($id, $name) { $this->id = $id; $this->name = $name; } }