You are here

public static function ResourceFieldCollection::factory in RESTful 7.2

Factory.

Creates the collection and each one of the field resource fields in it based on the configuration array.

Parameters

array $fields: An array of field mappings.

RequestInterface $request: The request.

Return value

ResourceFieldCollectionInterface The newly created object.

Overrides ResourceFieldCollectionInterface::factory

3 calls to ResourceFieldCollection::factory()
Resource::__construct in src/Plugin/resource/Resource.php
Constructs a Drupal\Component\Plugin\PluginBase object.
ResourceEntity::dataProviderFactory in src/Plugin/resource/ResourceEntity.php
Data provider factory.
ResourceFieldCollection::create in src/Plugin/resource/Field/ResourceFieldCollection.php
Factory.

File

src/Plugin/resource/Field/ResourceFieldCollection.php, line 147
Contains \Drupal\restful\Plugin\resource\Field\ResourceFieldCollection.

Class

ResourceFieldCollection

Namespace

Drupal\restful\Plugin\resource\Field

Code

public static function factory(array $fields = array(), RequestInterface $request = NULL) {

  // TODO: Explore the possibility to change factory methods by using FactoryInterface.
  return new static($fields, $request ?: restful()
    ->getRequest());
}