FieldBase.php in Lightgallery 8
File
src/Field/FieldBase.php
View source
<?php
namespace Drupal\lightgallery\Field;
abstract class FieldBase implements FieldInterface {
protected $name;
protected $title;
protected $type;
protected $description;
protected $isRequired;
protected $group;
protected $defaultValue;
protected $options;
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();
}
public function getName() {
return $this->name;
}
public function getTitle() {
return $this->title;
}
public function getType() {
return $this->type;
}
public function getDescription() {
return $this->description;
}
public function isRequired() {
return $this->isRequired;
}
public function getGroup() {
return $this->group;
}
public function getDefaultValue() {
return $this->defaultValue;
}
public function appliesToViews() {
return TRUE;
}
public function getOptions() {
return $this->options;
}
public function appliesToFieldFormatter() {
return TRUE;
}
protected function setIsRequired() {
return FALSE;
}
protected function setDefaultValue() {
return TRUE;
}
protected function setOptions() {
return FALSE;
}
protected abstract function setName();
protected abstract function setTitle();
protected abstract function setType();
protected abstract function setDescription();
protected abstract function setGroup();
}