Newscoop\Service\Implementation\ThemeServiceLocalFileSystem::getById PHP Method

getById() public method

* ---------------------------------------------------------------
public getById ( $id )
    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;
    }

Usage Example

Example #1
0
 public function __construct(IThemeService $service, $themeId)
 {
     $this->_service = $service;
     $this->_theme = $this->_service->getById($themeId);
 }