Piwik\Plugin\SettingsProvider::getAllMeasurableSettings PHP Метод

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

public getAllMeasurableSettings ( integer $idSite, string | null $idMeasurableType = null ) : MeasurableSettings[]
$idSite integer The ID of a site. If a site is about to be created pass idSite = 0.
$idMeasurableType string | null If null, idType will be detected automatically if the site already exists. Only needed to set a value when idSite = 0 (this is the case when a site is about) to be created.
Результат Piwik\Settings\Measurable\MeasurableSettings[]
    public function getAllMeasurableSettings($idSite, $idMeasurableType = null)
    {
        $pluginNames = $this->pluginManager->getActivatedPlugins();
        $byPluginName = array();
        foreach ($pluginNames as $plugin) {
            $component = $this->getMeasurableSettings($plugin, $idSite, $idMeasurableType);
            if (!empty($component)) {
                $byPluginName[$plugin] = $component;
            }
        }
        return $byPluginName;
    }

Usage Example

Пример #1
0
 /**
  * Returns all available measurable types.
  * Marked as deprecated so it won't appear in API page. It won't be a public API for now.
  * @deprecated
  * @return array
  */
 public function getAvailableMeasurableTypes()
 {
     Piwik::checkUserHasSomeViewAccess();
     $typeManager = new TypeManager();
     $types = $typeManager->getAllTypes();
     $available = array();
     foreach ($types as $type) {
         $measurableSettings = $this->settingsProvider->getAllMeasurableSettings($idSite = 0, $type->getId());
         $settingsMetadata = new SettingsMetadata();
         $available[] = array('id' => $type->getId(), 'name' => Piwik::translate($type->getName()), 'description' => Piwik::translate($type->getDescription()), 'howToSetupUrl' => $type->getHowToSetupUrl(), 'settings' => $settingsMetadata->formatSettings($measurableSettings));
     }
     return $available;
 }
All Usage Examples Of Piwik\Plugin\SettingsProvider::getAllMeasurableSettings