You are here

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

Same name and namespace in other branches
  1. 8.2 src/DateRecurNonRecurringHelper.php \Drupal\date_recur\DateRecurNonRecurringHelper::createInstance()
  2. 3.0.x src/DateRecurNonRecurringHelper.php \Drupal\date_recur\DateRecurNonRecurringHelper::createInstance()
  3. 3.1.x src/DateRecurNonRecurringHelper.php \Drupal\date_recur\DateRecurNonRecurringHelper::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 DateRecurNonRecurringHelper::createInstance()
DateRecurItem::getHelper in src/Plugin/Field/FieldType/DateRecurItem.php
Get the helper for this field item.
DateRecurNonRecurringHelperUnitTest::createHelper in tests/src/Unit/DateRecurNonRecurringHelperUnitTest.php
Creates a new helper.

File

src/DateRecurNonRecurringHelper.php, line 35

Class

DateRecurNonRecurringHelper
Dummy helper for handling non-recurring values.

Namespace

Drupal\date_recur

Code

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