You are here

public function SmartDateRule::getRuleOverrides in Smart Date 3.4.x

Same name and namespace in other branches
  1. 8.2 modules/smart_date_recur/src/Entity/SmartDateRule.php \Drupal\smart_date_recur\Entity\SmartDateRule::getRuleOverrides()
  2. 3.x modules/smart_date_recur/src/Entity/SmartDateRule.php \Drupal\smart_date_recur\Entity\SmartDateRule::getRuleOverrides()
  3. 3.0.x modules/smart_date_recur/src/Entity/SmartDateRule.php \Drupal\smart_date_recur\Entity\SmartDateRule::getRuleOverrides()
  4. 3.1.x modules/smart_date_recur/src/Entity/SmartDateRule.php \Drupal\smart_date_recur\Entity\SmartDateRule::getRuleOverrides()
  5. 3.2.x modules/smart_date_recur/src/Entity/SmartDateRule.php \Drupal\smart_date_recur\Entity\SmartDateRule::getRuleOverrides()
  6. 3.3.x modules/smart_date_recur/src/Entity/SmartDateRule.php \Drupal\smart_date_recur\Entity\SmartDateRule::getRuleOverrides()

Retrieve all overrides created for this rule.

1 call to SmartDateRule::getRuleOverrides()
SmartDateRule::getRuleInstances in modules/smart_date_recur/src/Entity/SmartDateRule.php
Provide a formatted array of instances, with any overrides applied.

File

modules/smart_date_recur/src/Entity/SmartDateRule.php, line 147

Class

SmartDateRule
Defines the Smart date rule entity.

Namespace

Drupal\smart_date_recur\Entity

Code

public function getRuleOverrides() {
  $result = \Drupal::entityQuery('smart_date_override')
    ->condition('rrule', $this
    ->id())
    ->execute();
  $overrides = [];
  if ($result && ($overrides_return = SmartDateOverride::loadMultiple($result))) {
    foreach ($overrides_return as $override) {
      $index = $override->rrule_index
        ->getString();
      $overrides[$index] = $override;
    }
  }
  return $overrides;
}