findMultipleComponents() public méthode

public findMultipleComponents ( $directoryWithinPlugin, $expectedSubclass )
 /**
  * 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;
 }
Exemple #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;
 }
Exemple #3
0
 /**
  * @return string[]
  */
 private function getAllWidgetContainerConfigClassNames()
 {
     return $this->pluginManager->findMultipleComponents('Widgets', 'Piwik\\Widget\\WidgetContainerConfig');
 }