App\Console\Commands\ThemeMake::getThemeId PHP Method

getThemeId() protected method

getThemeId
protected getThemeId ( PluginEntity $plugin, $class ) : array | string
$plugin Xpressengine\Plugin\PluginEntity
$class
return array | string
    protected function getThemeId(PluginEntity $plugin, $class)
    {
        $id = $this->option('id');
        if (!$id) {
            $id = $plugin->getId() . '@' . strtolower($class);
        } else {
            if (strpos('theme/', $id) === 0) {
                $id = substr($id, 6);
            }
            if (strpos($id, '@') === false) {
                $id = $plugin->getId() . '@' . $id;
            }
        }
        $theme = \App::make('xe.theme')->getTheme('theme/' . $id);
        if ($theme !== null) {
            throw new \Exception("Theme[{$theme}] already exists.");
        }
        return $id;
    }