You are here

PurgerSettingsBase.php in Purge 8.3

File

src/Plugin/Purge/Purger/PurgerSettingsBase.php
View source
<?php

namespace Drupal\purge\Plugin\Purge\Purger;

use Drupal\Core\Config\Entity\ConfigEntityBase;

/**
 * Provides an interface for purgers storing settings through config entities.
 */
abstract class PurgerSettingsBase extends ConfigEntityBase implements PurgerSettingsInterface {

  /**
   * Unique purger instance ID.
   *
   * @var string
   */
  protected $id;

  /**
   * {@inheritdoc}
   */
  public static function load($id) {
    if (!($settings = parent::load($id))) {
      $settings = self::create([
        'id' => $id,
      ]);
    }
    return $settings;
  }

}

Classes

Namesort descending Description
PurgerSettingsBase Provides an interface for purgers storing settings through config entities.