You are here

protected property ResourceFieldBase::$resource in RESTful 7.2

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 those bundles to their related resource. Items with bundles that were not explicitly set would be ignored.

It is also possible to pass an array as the value, with:

  • "name": The resource name.
  • "fullView": Determines if the referenced resource should be rendered,

or just the referenced ID(s) to appear. Defaults to TRUE. array( // Shorthand. 'article' => 'articles', // Verbose 'page' => array( 'name' => 'pages', 'fullView' => FALSE, ), );

Type: array

File

src/Plugin/resource/Field/ResourceFieldBase.php, line 104
Contains \Drupal\restful\Plugin\resource\Field\ResourceFieldBase.

Class

ResourceFieldBase

Namespace

Drupal\restful\Plugin\resource\Field

Code

protected $resource = array();