You are here

protected function CommerceTurnoverSensorPlugin::getOrderStates in Monitoring 8

Gets all order states from all workflows.

Return value

array An array of order states or empty array if no states found.

1 call to CommerceTurnoverSensorPlugin::getOrderStates()
CommerceTurnoverSensorPlugin::buildConfigurationForm in src/Plugin/monitoring/SensorPlugin/CommerceTurnoverSensorPlugin.php
Adds additional settings to the sensor configuration form.

File

src/Plugin/monitoring/SensorPlugin/CommerceTurnoverSensorPlugin.php, line 177

Class

CommerceTurnoverSensorPlugin
Monitors commerce order turnover stats.

Namespace

Drupal\monitoring\Plugin\monitoring\SensorPlugin

Code

protected function getOrderStates() {
  $states = [];
  foreach ($this->workflowManager
    ->getDefinitions() as $workflow) {
    if ($workflow['group'] == 'commerce_order') {
      foreach ($workflow['states'] as $key => $state) {
        $states[$key] = $state['label'];
      }
    }
  }
  return $states;
}