function getById($id) { Validation::notEmpty($id, 'id'); $theme = $this->findById($id); if (is_null($theme)) { throw new \Exception("There is no theme for id '{$id}'."); } return $theme; }
public function __construct(IThemeService $service, $themeId) { $this->_service = $service; $this->_theme = $this->_service->getById($themeId); }