findMultipleComponents() public method

public findMultipleComponents ( $directoryWithinPlugin, $expectedSubclass )
Exemplo n.º 1
0
 /**
  * Get all log table instances defined by any activated and loaded plugin. The returned tables are not sorted in
  * any order.
  * @return LogTable[]
  */
 public function getAllLogTables()
 {
     if (!isset($this->tablesCache)) {
         $tables = $this->pluginManager->findMultipleComponents('Tracker', 'Piwik\\Tracker\\LogTable');
         $this->tablesCache = array();
         foreach ($tables as $table) {
             $this->tablesCache[] = StaticContainer::get($table);
         }
     }
     return $this->tablesCache;
 }
Exemplo n.º 2
0
 /**
  * @return ReleaseChannel[]
  */
 public function getAllReleaseChannels()
 {
     $classNames = $this->pluginManager->findMultipleComponents('ReleaseChannel', 'Piwik\\UpdateCheck\\ReleaseChannel');
     $channels = array();
     foreach ($classNames as $className) {
         $channels[] = StaticContainer::get($className);
     }
     usort($channels, function (ReleaseChannel $a, ReleaseChannel $b) {
         if ($a->getOrder() === $b->getOrder()) {
             return 0;
         }
         return $a->getOrder() < $b->getOrder() ? -1 : 1;
     });
     return $channels;
 }
Exemplo n.º 3
0
 /**
  * @return string[]
  */
 private function getAllWidgetContainerConfigClassNames()
 {
     return $this->pluginManager->findMultipleComponents('Widgets', 'Piwik\\Widget\\WidgetContainerConfig');
 }