You are here

abstract class FieldBase in Lightgallery 8

Field base.

Hierarchy

Expanded class hierarchy of FieldBase

File

src/Field/FieldBase.php, line 8

Namespace

Drupal\lightgallery\Field
View source
abstract class FieldBase implements FieldInterface {
  protected $name;
  protected $title;
  protected $type;
  protected $description;
  protected $isRequired;
  protected $group;
  protected $defaultValue;
  protected $options;

  /**
   * {@inheritdoc}
   */
  public function __construct() {
    $this->name = $this
      ->setName();
    $this->title = $this
      ->setTitle();
    $this->type = $this
      ->setType();
    $this->description = $this
      ->setDescription();
    $this->isRequired = $this
      ->setIsRequired();
    $this->group = $this
      ->setGroup();
    $this->defaultValue = $this
      ->setDefaultValue();
    $this->options = $this
      ->setOptions();
  }

  /**
   * {@inheritdoc}
   */
  public function getName() {
    return $this->name;
  }

  /**
   * {@inheritdoc}
   */
  public function getTitle() {
    return $this->title;
  }

  /**
   * {@inheritdoc}
   */
  public function getType() {
    return $this->type;
  }

  /**
   * {@inheritdoc}
   */
  public function getDescription() {
    return $this->description;
  }

  /**
   * {@inheritdoc}
   */
  public function isRequired() {
    return $this->isRequired;
  }

  /**
   * {@inheritdoc}
   */
  public function getGroup() {
    return $this->group;
  }

  /**
   * {@inheritdoc}
   */
  public function getDefaultValue() {
    return $this->defaultValue;
  }

  /**
   * {@inheritdoc}
   */
  public function appliesToViews() {
    return TRUE;
  }

  /**
   * {@inheritdoc}
   */
  public function getOptions() {
    return $this->options;
  }

  /**
   * {@inheritdoc}
   */
  public function appliesToFieldFormatter() {
    return TRUE;
  }

  /**
   * Sets required flag.
   */
  protected function setIsRequired() {
    return FALSE;
  }

  /**
   * Sets default value.
   */
  protected function setDefaultValue() {
    return TRUE;
  }

  /**
   * Sets options.
   */
  protected function setOptions() {
    return FALSE;
  }

  /**
   * Sets name.
   */
  protected abstract function setName();

  /**
   * Sets title.
   */
  protected abstract function setTitle();

  /**
   * Sets type.
   */
  protected abstract function setType();

  /**
   * Sets description.
   */
  protected abstract function setDescription();

  /**
   * Sets group.
   */
  protected abstract function setGroup();

}

Members

Namesort descending Modifiers Type Description Overrides
FieldBase::$defaultValue protected property
FieldBase::$description protected property
FieldBase::$group protected property
FieldBase::$isRequired protected property
FieldBase::$name protected property
FieldBase::$options protected property
FieldBase::$title protected property
FieldBase::$type protected property
FieldBase::appliesToFieldFormatter public function Returns where the field has to be rendered in field formatter settings. Overrides FieldInterface::appliesToFieldFormatter 3
FieldBase::appliesToViews public function Returns where the field has to be rendered in view settings. Overrides FieldInterface::appliesToViews 3
FieldBase::getDefaultValue public function Returns field default value. Overrides FieldInterface::getDefaultValue
FieldBase::getDescription public function Returns field description. Overrides FieldInterface::getDescription
FieldBase::getGroup public function Returns field group (parent). Overrides FieldInterface::getGroup
FieldBase::getName public function Returns field name. Overrides FieldInterface::getName
FieldBase::getOptions public function Returns field options callback. Overrides FieldInterface::getOptions
FieldBase::getTitle public function Returns field title. Overrides FieldInterface::getTitle
FieldBase::getType public function Returns field type. Overrides FieldInterface::getType
FieldBase::isRequired public function Returns if field is required. Overrides FieldInterface::isRequired
FieldBase::setDefaultValue protected function Sets default value. 14
FieldBase::setDescription abstract protected function Sets description. 33
FieldBase::setGroup abstract protected function Sets group. 33
FieldBase::setIsRequired protected function Sets required flag. 2
FieldBase::setName abstract protected function Sets name. 33
FieldBase::setOptions protected function Sets options. 10
FieldBase::setTitle abstract protected function Sets title. 33
FieldBase::setType abstract protected function Sets type. 33
FieldBase::__construct public function