Remove the primary and parent theme from the view finder.

@param  Manifest  $theme
340903
protected function removeRegisteredLocation()
    {
        $current         = $this->where('slug', $this->getCurrent())->first();
        $currentLocation = $this->path('resources/views');

        app('view.finder')->removeLocation($currentLocation);

        if ($current->has('parent')) {
            $parent         = $this->where('slug', $current->get('parent'))->first();
            $parentLocation = $this->path('resources/views', $parent->slug);
            app('view.finder')->removeLocation($parentLocation);
        }
    }
869368
public function removeOrganization($organization)
    {
        $this->hasOrganizationsProperty();

        if ($this->organizations->contains($organization)) {
            $this->organizations->removeElement($organization);
        }
    }
496680
private function filterThemeLayoutUpdates(array $existThemePaths, array $themes)
    {
        foreach ($themes as $theme => $themePaths) {
            foreach ($themePaths as $pathIndex => $path) {
                if (is_string($path) && isset($existThemePaths[$path])) {
                    unset($themePaths[$pathIndex]);
                }
            }
            if (empty($themePaths)) {
                unset($themes[$theme]);
            } else {
                $themes[$theme] = $themePaths;
            }
        }

        return $themes;
    }
916737
public function delete()
    {     
        Util::delTree( $this->getPath() );
        foreach (Server::enum() as $s) {
            $tname = str_replace( THEME_DIR.'/', '', $s->templateDir );
            if ($tname == $this->name) {
                $s->setTheme();
            }
        }
    }
1260403
public function setTheme(View $view, $themes)
    {
        $cacheKey = $this->getCacheKey($view);

        $this->themes[$cacheKey] = $themes;
    }
802924
public function setDefault($theme) : Theme
    {
        if ($theme instanceof Theme) {
            $default = $theme;
        } elseif ($this->has($theme)) {
            $default = $this->get($theme);
        }

        if (!isset($default)) {
            throw new NullValueException("Cannot set default theme when theme does not exist");
        }

        if (!$default->verified()) {
            throw new \InvalidArgumentException("Cannot set default theme to an unverified theme");
        }

        return $this->default = $default;
    }
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;
    }
479380
private void clearParentFilter (SiteNode parent) {
		if (parent != null) {
			parent.setFiltered(false);
			clearParentFilter(parent.getParent());
		}
	}
344832
public function removeResource(Resource $resource)
    {
        if (!isset($this->resources[$resource->getUri()])) {
            return;
        }
        unset($this->resources[$resource->getUri()]);
    }
686879
public function delete(Theme $theme, User $user, $skipErrors = false)
    {
        if (!$this->canEdit($theme, $user)) {
            if (!$skipErrors) {
                throw new \Exception('You can not delete this theme.');
            } else {
                return;
            }
        }

        $this->om->remove($theme);
        $this->om->flush();

        // todo : to remove and delete src-files instead
        $fs = new Filesystem();
        $fs->remove("{$this->themeDir}/{$theme->getNormalizedName()}");
    }
870952
public function find_file($view, $themes = null)
	{
		if (is_null($themes))
		{
			$themes = $this->get_parent_themes($this->active['name']);
		}

		return parent::find_file($view, $themes);
	}
754597
protected function deleteManifest()
    {
        $manifests = find_paths(public_path('assets/').'manifest-*.json');
        foreach ($manifests as $manifest) {
            File::delete($manifest);
        }
    }
166952
private function mergePageTemplates(Theme $theme)
    {
        if ($theme->getParentTheme()) {
            $parentTheme = $this->getTheme($theme->getParentTheme());

            foreach ($parentTheme->getPageTemplates() as $parentPageTemplate) {
                $theme->addPageTemplate($parentPageTemplate);
            }

            foreach ($parentTheme->getPageTemplateTitles() as $route => $title) {
                if (!$theme->getPageTemplateTitle($route)) {
                    $theme->addPageTemplateTitle($route, $title);
                }
            }
        }

        return $theme;
    }
752891
public function setTheme($theme)
	{
	    $otheme = $this->options['theme'];
	    
		$this->options['theme'] = $theme;
		
		if ($otheme != $theme) {
		    $this->initViewConfig();
		}
		
		return $this;
	}
1017545
function remove( $conditions = null, $extraConditions = null )
    {
        if ( $this->attribute( 'version' ) == eZPDFExport::VERSION_VALID &&
             $this->attribute( 'status' ) != eZPDFExport::CREATE_ONFLY )
        {
            $sys = eZSys::instance();
            $storage_dir = $sys->storageDirectory();

            $filename = $storage_dir . '/pdf/' . $this->attribute( 'pdf_filename' );
            if ( file_exists( $filename ) )
            {
                unlink( $filename );
            }
        }
        parent::remove( $conditions, $extraConditions);
    }
939799
public function set($theme)
    {
        list($theme, $parent) = $this->resolveTheme($theme);

        if (! $this->isCurrently($theme->get('slug')) and (! is_null($this->getCurrent()))) {
            $this->removeRegisteredLocation();
        }

        $this->setCurrent($theme->get('slug'));
        
        $this->registerAutoload($this->format($theme->get('slug')));
        $this->addRegisteredLocation($theme, $parent);
        $this->symlinkPublicDirectory();
        $this->registerServiceProvider($this->format($theme->get('slug')));
    }
392878
public function removeGroup(int $index): void
    {
        unset($this->groups[$index]);
        $this->groups = array_values($this->groups);
    }