You are here

public function ResourceFieldDbColumn::value in RESTful 7.2

Gets the value for the field given a data source.

Parameters

DataInterpreterInterface $interpreter: The data source object. Interacts with the data storage.

Return value

mixed The value for the public field.

Throws

IncompatibleFieldDefinitionException

Overrides ResourceField::value

File

src/Plugin/resource/Field/ResourceFieldDbColumn.php, line 54
Contains \Drupal\restful\Plugin\resource\Field\ResourceFieldDbColumn.

Class

ResourceFieldDbColumn

Namespace

Drupal\restful\Plugin\resource\Field

Code

public function value(DataInterpreterInterface $interpreter) {
  $value = parent::value($interpreter);
  if (isset($value)) {
    return $value;
  }
  return $interpreter
    ->getWrapper()
    ->get($this
    ->getProperty());
}