You are here

public static function SlickBase::loadWithFallback in Slick Carousel 8.2

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

Load the optionset with a fallback.

File

src/Entity/SlickBase.php, line 134

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;
}