You are here

final class RlDateRecurRule in Recurring Dates Field 3.1.x

Same name and namespace in other branches
  1. 8.2 src/Rl/RlDateRecurRule.php \Drupal\date_recur\Rl\RlDateRecurRule
  2. 3.x src/Rl/RlDateRecurRule.php \Drupal\date_recur\Rl\RlDateRecurRule
  3. 3.0.x src/Rl/RlDateRecurRule.php \Drupal\date_recur\Rl\RlDateRecurRule

RRule object.

Hierarchy

Expanded class hierarchy of RlDateRecurRule

1 file declares its use of RlDateRecurRule
DateRecurRlInterpretationUnitTest.php in tests/src/Unit/DateRecurRlInterpretationUnitTest.php

File

src/Rl/RlDateRecurRule.php, line 14

Namespace

Drupal\date_recur\Rl
View source
final class RlDateRecurRule implements DateRecurRuleInterface {

  /**
   * The parts for this rule.
   *
   * @var array
   */
  protected $parts;

  /**
   * Creates a new RlDateRecurRule.
   *
   * @internal constructor subject to change at any time. Creating
   *   RlDateRecurRule objects is reserved by date_recur module.
   */
  public function __construct(array $parts) {
    if (!isset($parts['FREQ'])) {
      throw new \Exception('Frequency must be defined.');
    }
    $this->parts = $parts;
  }

  /**
   * {@inheritdoc}
   */
  public function getFrequency() : string {
    return $this->parts['FREQ'];
  }

  /**
   * {@inheritdoc}
   */
  public function getParts() : array {
    return $this->parts;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RlDateRecurRule::$parts protected property The parts for this rule.
RlDateRecurRule::getFrequency public function Get the frequency for the rule. Overrides DateRecurRuleInterface::getFrequency
RlDateRecurRule::getParts public function Get the RULE parts. Overrides DateRecurRuleInterface::getParts
RlDateRecurRule::__construct public function Creates a new RlDateRecurRule.