Piwik\Columns\Dimension::factory PHP Метод

factory() публичный статический Метод

Creates a Dimension instance from a string ID (see {@link getId()}).
public static factory ( string $dimensionId ) : Dimension | null
$dimensionId string See {@link getId()}.
Результат Dimension | null The created instance or null if there is no Dimension for $dimensionId or if the plugin that contains the Dimension is not loaded.
    public static function factory($dimensionId)
    {
        list($module, $dimension) = explode('.', $dimensionId);
        return ComponentFactory::factory($module, $dimension, __CLASS__);
    }

Usage Example

Пример #1
0
 private function setPivotByDimension($pivotByDimension)
 {
     $this->pivotByDimension = Dimension::factory($pivotByDimension);
     if (empty($this->pivotByDimension)) {
         throw new Exception("Invalid dimension '{$pivotByDimension}'.");
     }
     $this->pivotDimensionReport = Report::getForDimension($this->pivotByDimension);
 }
All Usage Examples Of Piwik\Columns\Dimension::factory