You are here

public function PublicFieldInfoBase::addSectionDefaults in RESTful 7.2

Merges default data in a section if it's not populated.

Parameters

string $section_name: The name of the categories. By default RESTful suports 'info', 'form_element' and 'data'.

array $section_info: The structured array with the section information.

Overrides PublicFieldInfoInterface::addSectionDefaults

File

src/Plugin/resource/Field/PublicFieldInfo/PublicFieldInfoBase.php, line 102
Contains \Drupal\restful\Plugin\resource\Field\PublicFieldInfo\PublicFieldInfoBase.

Class

PublicFieldInfoBase

Namespace

Drupal\restful\Plugin\resource\Field\PublicFieldInfo

Code

public function addSectionDefaults($section_name, array $section_info) {
  $this
    ->addCategory($section_name, array_merge($section_info, $this
    ->getSection($section_name)));
}