You are here

public static function SlickBase::loadWithFallback in Slick Carousel 7.3

Same name and namespace in other branches
  1. 8.2 src/Entity/SlickBase.php \Drupal\slick\Entity\SlickBase::loadWithFallback()

Load the optionset with a fallback.

File

src/Entity/SlickBase.php, line 79

Class

SlickBase
Defines the Slick configuration entity.

Namespace

Drupal\slick\Entity

Code

public static function loadWithFallback($id) {
  $optionset = self::load($id);

  // Ensures deleted optionset while being used doesn't screw up.
  if (empty($optionset)) {
    $optionset = self::load('default');
  }
  return $optionset;
}