You are here

public function AcquiaContentHubGenerateNullFieldItemList::generateSampleItems in Acquia Content Hub 8.2

Populates a specified number of field items with valid sample data.

Parameters

int $count: The number of items to create.

Overrides FieldItemList::generateSampleItems

File

src/Plugin/Field/AcquiaContentHubGenerateNullFieldItemList.php, line 17

Class

AcquiaContentHubGenerateNullFieldItemList
Generates null field item for sample data.

Namespace

Drupal\acquia_contenthub\Plugin\Field

Code

public function generateSampleItems($count = 1) {
  $values = array_fill(0, $count, NULL);
  $this
    ->setValue($values);
}