You are here

public static function ResourceFieldResource::create in RESTful 7.2

Factory.

Parameters

array $field: Contains the field values.

RequestInterface $request: The request.

Return value

ResourceFieldInterface The created field

Throws

ServerConfigurationException

Overrides ResourceFieldInterface::create

1 call to ResourceFieldResource::create()
ResourceFieldCollection::__construct in src/Plugin/resource/Field/ResourceFieldCollection.php
Constructor.

File

src/Plugin/resource/Field/ResourceFieldResource.php, line 133
Contains \Drupal\restful\Plugin\resource\Field\ResourceFieldResource.

Class

ResourceFieldResource

Namespace

Drupal\restful\Plugin\resource\Field

Code

public static function create(array $field, RequestInterface $request = NULL) {
  $request = $request ?: restful()
    ->getRequest();
  $resource_field = ResourceField::create($field, $request);
  $output = new static($field, $request);
  $output
    ->decorate($resource_field);
  return $output;
}