class ResourceFieldKeyValue in RESTful 7.2
Hierarchy
- class \Drupal\restful\Plugin\resource\Field\ResourceFieldBase implements ResourceFieldInterface
- class \Drupal\restful\Plugin\resource\Field\ResourceField implements ResourceFieldInterface
- class \Drupal\restful\Plugin\resource\Field\ResourceFieldKeyValue implements ResourceFieldInterface
- class \Drupal\restful\Plugin\resource\Field\ResourceField implements ResourceFieldInterface
Expanded class hierarchy of ResourceFieldKeyValue
File
- src/
Plugin/ resource/ Field/ ResourceFieldKeyValue.php, line 13 - Contains \Drupal\restful\Plugin\resource\Field\ResourceFieldKeyValue.
Namespace
Drupal\restful\Plugin\resource\FieldView source
class ResourceFieldKeyValue extends ResourceField implements ResourceFieldInterface {
/**
* {@inheritdoc}
*/
public static function create(array $field, RequestInterface $request = NULL) {
$request = $request ?: restful()
->getRequest();
$resource_field = new static($field, $request);
$resource_field
->addDefaults();
return $resource_field;
}
/**
* {@inheritdoc}
*/
public function value(DataInterpreterInterface $interpreter) {
if ($value = parent::value($interpreter)) {
return $value;
}
return $interpreter
->getWrapper()
->get($this
->getProperty());
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ResourceField:: |
public | function |
Check access on property by the defined access callbacks. Overrides ResourceFieldInterface:: |
|
ResourceField:: |
public | function |
Adds the default values to the definitions array. Overrides ResourceFieldInterface:: |
|
ResourceField:: |
public | function |
Fetches the embedded identifier(s) for the current resource field, if any. Overrides ResourceFieldInterface:: |
1 |
ResourceField:: |
public static | function | Get the class name to use based on the field definition. | |
ResourceField:: |
public | function |
Gets the cardinality of the wrapped field. Overrides ResourceFieldInterface:: |
|
ResourceField:: |
public | function |
Gets the value of a field and applies all process callbacks to it. Overrides ResourceFieldInterface:: |
|
ResourceField:: |
public | function |
Gets the value for the field given a data source. Overrides ResourceFieldInterface:: |
|
ResourceField:: |
public | function |
Set the cardinality. Overrides ResourceFieldInterface:: |
|
ResourceField:: |
public | function | Constructor. | 1 |
ResourceFieldBase:: |
protected | property | An array of callbacks to determine if user has access to the property. Note that this callback is on top of the access provided by entity API, and is used for convenience, where for example write operation on a property should be denied only on… | |
ResourceFieldBase:: |
protected | property | A callable callback to get a computed value. The wrapped entity is passed as argument. Defaults To FALSE. The callback function receive as first argument the entity. | |
ResourceFieldBase:: |
protected | property | Holds the field cardinality. | |
ResourceFieldBase:: |
protected | property | The field definition array. | |
ResourceFieldBase:: |
protected | property | A generic array storage. | |
ResourceFieldBase:: |
protected | property | The HTTP methods where this field applies. | |
ResourceFieldBase:: |
protected | property | An array of callbacks to perform on the returned value, or an array with the object and method. | |
ResourceFieldBase:: |
protected | property | The entity property (e.g. "title", "nid"). | |
ResourceFieldBase:: |
protected | property | Information about the field. | |
ResourceFieldBase:: |
protected | property | Contains the public field name. | |
ResourceFieldBase:: |
protected | property | The request object to be used. | |
ResourceFieldBase:: |
protected | property | This property can be assigned only to an entity reference field. Array of restful resources keyed by the target bundle. For example, if the field is referencing a node entity, with "Article" and "Page" bundles, we are able to map… | |
ResourceFieldBase:: |
constant | Return this value from public field access callbacks to allow access. | ||
ResourceFieldBase:: |
constant | Return this value from public field access callbacks to deny access. | ||
ResourceFieldBase:: |
constant | Return this value from public field access callbacks to not affect access. | ||
ResourceFieldBase:: |
public | function |
Add metadata to the field. Overrides ResourceFieldInterface:: |
|
ResourceFieldBase:: |
public | function | Basic auto discovery information. | |
ResourceFieldBase:: |
public static | function | Returns the basic discovery information for a given field. | |
ResourceFieldBase:: |
public | function |
Executes the process callbacks. Overrides ResourceFieldInterface:: |
|
ResourceFieldBase:: |
public | function |
Overrides ResourceFieldInterface:: |
|
ResourceFieldBase:: |
public | function |
Overrides ResourceFieldInterface:: |
|
ResourceFieldBase:: |
public | function |
Gets the original field definition as declared in Resource::publicFields(). Overrides ResourceFieldInterface:: |
|
ResourceFieldBase:: |
public | function |
Add metadata to the field. Overrides ResourceFieldInterface:: |
|
ResourceFieldBase:: |
public | function |
Overrides ResourceFieldInterface:: |
|
ResourceFieldBase:: |
public | function |
Overrides ResourceFieldInterface:: |
|
ResourceFieldBase:: |
public | function |
Overrides ResourceFieldInterface:: |
|
ResourceFieldBase:: |
public | function |
Gets the public field info object. Overrides ResourceFieldInterface:: |
|
ResourceFieldBase:: |
public | function |
Overrides ResourceFieldInterface:: |
|
ResourceFieldBase:: |
public | function |
Get the request in the data provider. Overrides ResourceFieldInterface:: |
|
ResourceFieldBase:: |
public | function |
Overrides ResourceFieldInterface:: |
|
ResourceFieldBase:: |
public | function |
Gets the ID of the resource field. Overrides ResourceFieldInterface:: |
|
ResourceFieldBase:: |
protected | function | Returns the last array element from the nested namespace array. | |
ResourceFieldBase:: |
final public static | function |
Helper method to determine if an array is numeric. Overrides ResourceFieldInterface:: |
|
ResourceFieldBase:: |
public | function |
Checks if the current field is computed. Overrides ResourceFieldInterface:: |
|
ResourceFieldBase:: |
public | function |
Overrides ResourceFieldInterface:: |
|
ResourceFieldBase:: |
public | function |
Overrides ResourceFieldInterface:: |
|
ResourceFieldBase:: |
public | function |
Overrides ResourceFieldInterface:: |
|
ResourceFieldBase:: |
public | function |
Overrides ResourceFieldInterface:: |
|
ResourceFieldBase:: |
public | function |
Overrides ResourceFieldInterface:: |
|
ResourceFieldBase:: |
public | function |
Gets the public field info object. Overrides ResourceFieldInterface:: |
|
ResourceFieldBase:: |
public | function |
Overrides ResourceFieldInterface:: |
|
ResourceFieldBase:: |
public | function |
Set the request. Overrides ResourceFieldInterface:: |
|
ResourceFieldBase:: |
public | function |
Overrides ResourceFieldInterface:: |
|
ResourceFieldKeyValue:: |
public static | function |
Factory. Overrides ResourceField:: |
|
ResourceFieldKeyValue:: |
public | function |
Gets the value for the field given a data source. Overrides ResourceField:: |