MissingThemeDependencyException.php 850 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace Drupal\Core\Theme;
  3. /**
  4. * Exception to be thrown when base theme for installed theme is not installed.
  5. *
  6. * @see \Drupal\Core\Theme\ThemeInitialization::getActiveThemeByName().
  7. */
  8. class MissingThemeDependencyException extends \Exception {
  9. /**
  10. * The missing theme dependency.
  11. *
  12. * @var string
  13. */
  14. protected $theme;
  15. /**
  16. * Constructs the exception.
  17. *
  18. * @param string $message
  19. * The exception message.
  20. * @param string $theme
  21. * The missing theme dependency.
  22. */
  23. public function __construct($message, $theme) {
  24. parent::__construct($message);
  25. $this->theme = $theme;
  26. }
  27. /**
  28. * Gets the machine name of the missing theme.
  29. *
  30. * @return string
  31. * The machine name of the theme that is missing.
  32. */
  33. public function getMissingThemeName() {
  34. return $this->theme;
  35. }
  36. }