Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ThemePackage.php
Go to the documentation of this file.
1 <?php
7 
9 
14 {
20  private $area;
21 
27  private $vendor;
28 
34  private $name;
35 
41  private $key;
42 
48  private $path;
49 
56  public function __construct($key, $path)
57  {
58  $keyParts = explode(Theme::THEME_PATH_SEPARATOR, $key);
59  if (count($keyParts) != 3) {
60  throw new \UnexpectedValueException(
61  "Theme's key does not correspond to required format: '<area>/<vendor>/<name>'"
62  );
63  }
64 
65  $this->key = $key;
66  $this->path = $path;
67  $this->area = $keyParts[0];
68  $this->vendor = $keyParts[1];
69  $this->name = $keyParts[2];
70  }
71 
77  public function getArea()
78  {
79  return $this->area;
80  }
81 
87  public function getVendor()
88  {
89  return $this->vendor;
90  }
91 
97  public function getName()
98  {
99  return $this->name;
100  }
101 
107  public function getKey()
108  {
109  return $this->key;
110  }
111 
117  public function getPath()
118  {
119  return $this->path;
120  }
121 }