Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
FullModuleList.php
Go to the documentation of this file.
1 <?php
7 
14 {
20  private $loader;
21 
27  private $data;
28 
34  public function __construct(ModuleList\Loader $loader)
35  {
36  $this->loader = $loader;
37  }
38 
43  public function getAll()
44  {
45  if (null === $this->data) {
46  $this->data = $this->loader->load();
47  }
48  return $this->data;
49  }
50 
55  public function getOne($name)
56  {
57  $data = $this->getAll();
58  return $data[$name] ?? null;
59  }
60 
64  public function getNames()
65  {
66  $data = $this->getAll();
67  return array_keys($data);
68  }
69 
73  public function has($name)
74  {
75  $this->getAll();
76  return isset($this->data[$name]);
77  }
78 }
$loader
Definition: autoload.php:8
__construct(ModuleList\Loader $loader)
if(!isset($_GET['name'])) $name
Definition: log.php:14