Sets the theme(s) to be used for rendering a block and its children

@param string|string[] $themes  The theme(s). For example 'MyBundle:Layout:my_theme.html.twig'
@param string|null     $blockId The id of a block to assign the theme(s) to

@return self
482346
public function setBlockTheme($themes, $blockId = null)
    {
        $view = $blockId
            ? $this->view[$blockId]
            : $this->view;

        $this->themes[] = [$view, $themes];

        return $this;
    }
502839
public function refresh(ThemeSlotsInterface $themeSlots, Template $template = null, PageBlocksInterface $pageBlocks = null)
    {
        $this->themeSlots = $themeSlots;
        $this->template = $template;
        $this->pageBlocks = $pageBlocks;

        $this->setUpSlotManagers();

        return $this;
    }
458324
public function setTheme($theme)
    {
        if($this->theme instanceof Theme) {
            $this->assets->removeFilePath($this->theme->getRealPath());
        }

        if (is_bool($theme)) {
            $this->theme = false;
        } elseif(($moduleTheme = modules()->top()->getTheme($theme, true)) instanceof Theme) {
            $this->theme = $moduleTheme;
        } elseif(($appTheme = modules()->first()->getTheme($theme, true)) instanceof Theme) {
            $this->theme = $appTheme;
        }

        if($this->theme) {
            if ( ! defined('PATH_THEME')) {
                define('PATH_THEME', $this->theme->getRealPath());
            }

            // add theme assets directory
            $this->assets->pushFilePath($this->theme->getRealPath());

            if(is_dir($themeViewPath = $this->theme->getRealPath() . 'views' . DIRECTORY_SEPARATOR)) {

                // add theme view directory
                view()->addFilePath($this->theme->getRealPath());

                // add theme output directory
                output()->pushFilePath($themeViewPath);

                $modules = modules()->getArrayCopy();

                foreach($modules as $module) {
                    if ( ! in_array($module->getType(), ['KERNEL', 'FRAMEWORK', 'APP'])) {
                        $moduleResourcesPath = str_replace(PATH_RESOURCES, '', $module->getResourcesDir());

                        if(is_dir($themeViewPath . $moduleResourcesPath)) {
                            view()->pushFilePath($themeViewPath . $moduleResourcesPath);
                        }
                    }
                }
            }
        }
        
        return $this;
    }
515792
public function openOrchestraCss($themeId)
    {
        $tags = '';

        if (isset($this->themes[$themeId]) && isset($this->themes[$themeId]['stylesheets'])) {
            $stylesheets = $this->themes[$themeId]['stylesheets'];
            foreach ($stylesheets as $stylesheet) {
                $tags .= $this->getHtmlTag($stylesheet, self::FILETYPE_CSS);
            }
        }

        return $tags;
    }
969606
public function block(array $blockAttrs = [])
    {
        $this->block = array_merge(array_get($this->attributes, 'block', []), $blockAttrs);
        return $this;
    }
396365
public function setTheme(DataSourceViewInterface $dataSource, $theme, array $vars = [])
    {
        $this->themes[$dataSource->getName()] = ($theme instanceof Twig_Template)
            ? $theme
            : $this->environment->loadTemplate($theme);
        $this->themesVars[$dataSource->getName()] = $vars;
    }
581049
public function setTemplate($templateId)
    {
        if ($template = $this->getTemplate($templateId)) {
            $this->subject = $template['gctt_subject'];
            $this->bodyBb = $template['gctt_body'];
            $this->setTemplateId($templateId);
        }
    }
1308629
public function getBlock(?string $blockId = null): GetBlockResponse
    {
        $command = new GetBlockCommand($blockId);
        $response = $this->driver->executeCommand($command);

        return new GetBlockResponse($response->getRawData());
    }
44173
public function loadLayoutBlockIds($layoutId, ?int $status = null): array
    {
        $query = $this->connection->createQueryBuilder();
        $query->select('DISTINCT id')
            ->from('ngbm_block')
            ->where(
                $query->expr()->eq('layout_id', ':layout_id')
            )
            ->setParameter('layout_id', $layoutId, Type::INTEGER);

        if ($status !== null) {
            $this->applyStatusCondition($query, $status);
        }

        $result = $query->execute()->fetchAll(PDO::FETCH_ASSOC);

        return array_column($result, 'id');
    }
592213
public function setTheme(?string $key = null, bool $overrideKey = false) : Theme
    {
        if ($this->useTheme !== null && ($key === null || $this->useTheme === $key)) {
            return $this->useTheme;
        }

        if ($overrideKey) {
            return $this->useTheme = $this->getTheme($key);
        }

        if ($this->themes->hasOverride()) {
            return $this->useTheme = $this->themes->getOverride();
        }

        if ($this->hasUserOverride()) {
            return $this->useTheme = $this->themes->setOverride($this->getUserOverride());
        }

        return $this->useTheme = $this->getTheme($key);
    }
274828
public function setBlock(string $blockID, string $source): Isolator
    {
        if (!isset($this->phpBlocks[$blockID])) {
            throw new IsolatorException("Undefined block {$blockID}");
        }

        $this->phpBlocks[$blockID] = $source;

        return $this;
    }
1216106
protected function loadViewsFromTheme(Theme $theme)
    {
        $views = $theme->getViewDirectory();

        $this->loadViewsFrom($views, $theme->getName());
        $this->loadViewsFrom($views.'/boomcms', 'boomcms');
        $this->loadViewsFrom($views.'/chunks', 'boomcms.chunks');
    }
421634
public function setGroupId( $groupId )
    {
        $this->groupId = (int) $groupId ?: null;

        if ( $this->group && $this->group->id != $this->groupId )
        {
            $this->group = null;
        }

        return $this;
    }
224326
public static function theme($theme = null)
    {
        if (!self::$_initialized) {
            self::init();
        }

        if ($theme !== null) {
            if (!isset(self::$_themes[$theme])) {
                throw new Exception(__d('wasabi_cms', 'Theme "{0}" does not exist.', $theme));
            }
            self::$_theme = self::$_themes[$theme];
        }

        return self::$_theme;
    }
628497
public function setParent(BlockInterface $parent = null)
    {
        if (null !== $parent && '' === $this->config->getName()) {
            throw new LogicException('A block with an empty name cannot have a parent block.');
        }

        $this->parent = $parent;

        return $this;
    }
749482
public function get($themeId, array $params = array())
    {
        $endpoint = '/admin/themes/'.$themeId.'.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createObject(Theme::class, $response['theme']);
    }
440598
public function setTheme($theme, $themeFolder = ThemesManager::THEMES_FOLDER) {
		$path = \ROOT . \DS . 'views' . \DS . $themeFolder . \DS . $theme;
		if ($theme == '') {
			$path = \ROOT . \DS . 'views';
		}
		if (file_exists ( $path )) {
			$this->loader->setPaths ( [ $path ], "activeTheme" );
		} else {
			throw new ThemesException ( sprintf ( 'The path `%s` does not exists!', $path ) );
		}
	}