Piwik\Plugin::findMultipleComponents PHP Метод

findMultipleComponents() публичный Метод

public findMultipleComponents ( $directoryWithinPlugin, $expectedSubclass )
    public function findMultipleComponents($directoryWithinPlugin, $expectedSubclass)
    {
        $this->createCacheIfNeeded();
        $cacheId = 'Plugin' . $this->pluginName . $directoryWithinPlugin . $expectedSubclass;
        if ($this->cache->contains($cacheId)) {
            $components = $this->cache->fetch($cacheId);
            if ($this->includeComponents($components)) {
                return $components;
            } else {
                // problem including one cached file, refresh cache
            }
        }
        $components = $this->doFindMultipleComponents($directoryWithinPlugin, $expectedSubclass);
        $this->cache->save($cacheId, $components);
        return $components;
    }

Usage Example

Пример #1
0
 /**
  * Get all action dimensions that are defined by the given plugin.
  * @param Plugin $plugin
  * @return ActionDimension[]
  * @ignore
  */
 public static function getDimensions(Plugin $plugin)
 {
     $dimensions = $plugin->findMultipleComponents('Columns', '\\Piwik\\Plugin\\Dimension\\ActionDimension');
     $instances = array();
     foreach ($dimensions as $dimension) {
         $instances[] = new $dimension();
     }
     return $instances;
 }
All Usage Examples Of Piwik\Plugin::findMultipleComponents