protected function getImage(BasicList $list) { $image = $list->getImage(); if (!$image) { throw new LogicException('Image enumeration type requires not empty attribute "image" of BasicList.'); } return $image; }