public function findItemByAttribute($key, $value) { $itemLists = $this->getAllItemListsIncludingThisOne()->getMenuObjects(); foreach ($itemLists as $itemList) { if ($itemList->getAttibute($key) == $value) { return $itemList; } } return false; }