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

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

Returns the name of the plugin that contains this Dimension.
public getModule ( ) : string
Результат string
    public function getModule()
    {
        $id = $this->getId();
        if (empty($id)) {
            throw new Exception("Invalid dimension ID: '{$id}'.");
        }
        $parts = explode('.', $id);
        return reset($parts);
    }

Usage Example

Пример #1
0
 /**
  * Finds a top level report that provides stats for a specific Dimension.
  *
  * @param Dimension $dimension The dimension whose report we're looking for.
  * @return Report|null The
  * @api
  */
 public static function getForDimension(Dimension $dimension)
 {
     return ComponentFactory::getComponentIf(__CLASS__, $dimension->getModule(), function (Report $report) use($dimension) {
         return !$report->isSubtableReport() && $report->getDimension() && $report->getDimension()->getId() == $dimension->getId();
     });
 }