Chris@0: '', Chris@0: 'engine' => 'twig', Chris@0: 'owner' => 'twig', Chris@0: 'stylesheets_remove' => [], Chris@0: 'libraries' => [], Chris@0: 'extension' => 'html.twig', Chris@0: 'base_themes' => [], Chris@0: 'regions' => [], Chris@0: 'libraries_override' => [], Chris@0: 'libraries_extend' => [], Chris@0: ]; Chris@0: Chris@0: $this->name = $values['name']; Chris@0: $this->path = $values['path']; Chris@0: $this->engine = $values['engine']; Chris@0: $this->owner = $values['owner']; Chris@0: $this->styleSheetsRemove = $values['stylesheets_remove']; Chris@0: $this->libraries = $values['libraries']; Chris@0: $this->extension = $values['extension']; Chris@0: $this->baseThemes = $values['base_themes']; Chris@0: $this->regions = $values['regions']; Chris@0: $this->librariesOverride = $values['libraries_override']; Chris@0: $this->librariesExtend = $values['libraries_extend']; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Returns the machine name of the theme. Chris@0: * Chris@0: * @return string Chris@0: */ Chris@0: public function getName() { Chris@0: return $this->name; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Returns the path to the theme directory. Chris@0: * Chris@0: * @return string Chris@0: */ Chris@0: public function getPath() { Chris@0: return $this->path; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Returns the theme engine. Chris@0: * Chris@0: * @return string Chris@0: */ Chris@0: public function getEngine() { Chris@0: return $this->engine; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Returns the path to the theme engine for root themes. Chris@0: * Chris@0: * @see \Drupal\Core\Extension\ThemeHandler::rebuildThemeData Chris@0: * Chris@0: * @return mixed Chris@0: */ Chris@0: public function getOwner() { Chris@0: return $this->owner; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Returns the extension object. Chris@0: * Chris@0: * @return \Drupal\Core\Extension\Extension Chris@0: */ Chris@0: public function getExtension() { Chris@0: return $this->extension; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Returns the libraries provided by the theme. Chris@0: * Chris@0: * @return mixed Chris@0: */ Chris@0: public function getLibraries() { Chris@0: return $this->libraries; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Returns the removed stylesheets by the theme. Chris@0: * Chris@0: * @return mixed Chris@0: * Chris@0: * @deprecated in Drupal 8.0.0, will be removed before Drupal 9.0.0. Chris@0: * Chris@0: * @see https://www.drupal.org/node/2497313 Chris@0: */ Chris@0: public function getStyleSheetsRemove() { Chris@0: return $this->styleSheetsRemove; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Returns an array of base theme active theme objects keyed by name. Chris@0: * Chris@0: * The order starts with the base theme of $this and ends with the root of Chris@0: * the dependency chain. Chris@0: * Chris@0: * @return static[] Chris@0: */ Chris@0: public function getBaseThemes() { Chris@0: return $this->baseThemes; Chris@0: } Chris@0: Chris@0: /** Chris@0: * The regions used by the theme. Chris@0: * Chris@0: * @return string[] Chris@0: * The list of region machine names supported by the theme. Chris@0: * Chris@0: * @see system_region_list() Chris@0: */ Chris@0: public function getRegions() { Chris@0: return array_keys($this->regions); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Returns the libraries or library assets overridden by the active theme. Chris@0: * Chris@0: * @return array Chris@0: * The list of libraries overrides. Chris@0: */ Chris@0: public function getLibrariesOverride() { Chris@0: return $this->librariesOverride; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Returns the libraries extended by the active theme. Chris@0: * Chris@0: * @return array Chris@0: * The list of libraries-extend definitions. Chris@0: */ Chris@0: public function getLibrariesExtend() { Chris@0: return $this->librariesExtend; Chris@0: } Chris@0: Chris@0: }