Piwik\Plugin\Manager::findMultipleComponents PHP Method

findMultipleComponents() public method

public findMultipleComponents ( $directoryWithinPlugin, $expectedSubclass )
    public function findMultipleComponents($directoryWithinPlugin, $expectedSubclass)
    {
        $plugins = $this->getPluginsLoadedAndActivated();
        $found = array();
        foreach ($plugins as $plugin) {
            $components = $plugin->findMultipleComponents($directoryWithinPlugin, $expectedSubclass);
            if (!empty($components)) {
                $found = array_merge($found, $components);
            }
        }
        return $found;
    }

Usage Example

Example #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;
 }
All Usage Examples Of Piwik\Plugin\Manager::findMultipleComponents
Manager