modules/acm/src/CommerceDashboardItemManager.php
public function getDashboardItems() {
    $instances = [];
    $sortedDefinitions = [];
    $definitions = $this->getDefinitions();

    foreach ($definitions as $id => $definition) {
      $sortedDefinitions[$definition['group']][$id] = $definition;
    }

    foreach ($sortedDefinitions as &$localSortedDefinitions) {
      usort($localSortedDefinitions, [$this, 'sortPlugins']);
    }

    foreach ($sortedDefinitions as $group => $localDefinitions) {
      foreach ($localDefinitions as $definition) {
        $id = $definition['id'];
        $instances[$group][$id] = $this->createInstance($id)->render();
      }
    }

    return $instances;
  }
public function getDashboardItems() {
    $instances = [];
    $sortedDefinitions = [];
    $definitions = $this->getDefinitions();

    foreach ($definitions as $id => $definition) {
      $sortedDefinitions[$definition['group']][$id] = $definition;
    }

    foreach ($sortedDefinitions as &$localSortedDefinitions) {
      usort($localSortedDefinitions, [$this, 'sortPlugins']);
    }

    foreach ($sortedDefinitions as $group => $localDefinitions) {
      foreach ($localDefinitions as $definition) {
        $id = $definition['id'];
        $instances[$group][$id] = $this->createInstance($id)->render();
      }
    }

    return $instances;
  }
public function getDashboardItems ( ) { $ instances = [ ] ; $ sortedDefinitions = [ ] ; $ definitions = $ this -> getDefinitions ( ) ; foreach ( $ definitions as $ id => $ definition ) { $ sortedDefinitions [ $ definition [ 'group' ] ] [ $ id ] = $ definition ; } foreach ( $ sortedDefinitions as & $ localSortedDefinitions ) { usort ( $ localSortedDefinitions , [ $ this , 'sortPlugins' ] ) ; } foreach ( $ sortedDefinitions as $ group => $ localDefinitions ) { foreach ( $ localDefinitions as $ definition ) { $ id = $ definition [ 'id' ] ; $ instances [ $ group ] [ $ id ] = $ this -> createInstance ( $ id ) -> render ( ) ; } } return $ instances ; }
Creates pre-configured instances of all plugins.

@return \Drupal\acm\CommerceDashboardItemInterface[][]
An array of fully configured plugin instances.

@throws \Drupal\Component\Plugin\Exception\PluginException
If an instance cannot be created, such as if the ID is invalid.
Creates pre - configured instances of all plugins .