Piwik\Plugins\Live\ProfileSummary\

ProfileSummaryAbstract

Class ProfileSummaryAbstract

This class can be implemented in a plugin to provide a new profile summary

Methods

The abstract class defines the following methods:

  • setProfile() — Set profile information
  • getId() — Returns the unique ID
  • getName() — Returns the descriptive name
  • render() — Renders and returns the summary
  • getOrder() — Returns order indicator used to sort all summaries before displaying them

setProfile()

Set profile information

Signature

  • It accepts the following parameter(s):

    • $profile (array) —
  • It does not return anything or a mixed result.

getId()

Returns the unique ID

Signature

  • It returns a string value.

getName()

Returns the descriptive name

Signature

  • It returns a string value.

render()

Renders and returns the summary

Example

public function render() {
    if (empty($this->profile['crmData'])) {
        return '';
    }

    $view = new View('@pluginName/summary.twig');
    $view->crmData = $this->profile['crmData];
    return $view->render();
}

Signature

  • It returns a string value.

getOrder()

Returns order indicator used to sort all summaries before displaying them

Signature

  • It returns a int value.