You are here

public static function SmartDateRule::getThirdPartyFallback in Smart Date 3.1.x

Same name and namespace in other branches
  1. 3.2.x modules/smart_date_recur/src/Entity/SmartDateRule.php \Drupal\smart_date_recur\Entity\SmartDateRule::getThirdPartyFallback()
  2. 3.3.x modules/smart_date_recur/src/Entity/SmartDateRule.php \Drupal\smart_date_recur\Entity\SmartDateRule::getThirdPartyFallback()
  3. 3.4.x modules/smart_date_recur/src/Entity/SmartDateRule.php \Drupal\smart_date_recur\Entity\SmartDateRule::getThirdPartyFallback()

Retrieve the months_limit value from the field definition.

4 calls to SmartDateRule::getThirdPartyFallback()
SmartDateRule::getMonthsLimit in modules/smart_date_recur/src/Entity/SmartDateRule.php
Retrieve the months_limit value from the field definition.
smart_date_recur_field_widget_settings_summary_alter in modules/smart_date_recur/smart_date_recur.module
Implements hook_field_formatter_settings_summary_alter().
smart_date_recur_field_widget_third_party_settings_form in modules/smart_date_recur/smart_date_recur.module
Implements hook_field_widget_third_party_settings_form().
smart_date_recur_widget_extra_fields in modules/smart_date_recur/smart_date_recur.module
Helper function to add extra fields to Smart Date widgets.

File

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

Class

SmartDateRule
Defines the Smart date rule entity.

Namespace

Drupal\smart_date_recur\Entity

Code

public static function getThirdPartyFallback($field_def, $property, $default = NULL) {
  $value = $default;
  if (method_exists($field_def, 'getThirdPartySetting')) {

    // Works for field definitions and rule objects.
    $value = $field_def
      ->getThirdPartySetting('smart_date_recur', $property, $default);
  }
  elseif (method_exists($field_def, 'getSetting')) {

    // For custom entities, set value in your field definition.
    $value = $field_def
      ->getSetting($property);
  }
  return $value;
}