You are here

public static function RlHelper::createInstance in Recurring Dates Field 3.x

Same name and namespace in other branches
  1. 8.2 src/Rl/RlHelper.php \Drupal\date_recur\Rl\RlHelper::createInstance()
  2. 3.0.x src/Rl/RlHelper.php \Drupal\date_recur\Rl\RlHelper::createInstance()
  3. 3.1.x src/Rl/RlHelper.php \Drupal\date_recur\Rl\RlHelper::createInstance()

Create a new instance.

Parameters

string $string: The repeat rule.

\DateTimeInterface $dtStart: The initial occurrence start date.

\DateTimeInterface|null $dtStartEnd: The initial occurrence end date, or NULL to use start date.

Return value

\Drupal\date_recur\DateRecurHelperInterface An instance of helper.

Overrides DateRecurHelperInterface::createInstance

2 calls to RlHelper::createInstance()
DateRecurHelper::create in src/DateRecurHelper.php
Create a instance of helper using system default.
DateRecurRlHelperUnitTest::createHelper in tests/src/Unit/DateRecurRlHelperUnitTest.php
Creates a new helper.

File

src/Rl/RlHelper.php, line 123

Class

RlHelper
Helper for recurring rules implemented with rlanvin/rrule.

Namespace

Drupal\date_recur\Rl

Code

public static function createInstance(string $string, \DateTimeInterface $dtStart, ?\DateTimeInterface $dtStartEnd = NULL) : DateRecurHelperInterface {
  return new static($string, $dtStart, $dtStartEnd);
}