You are here

public static function Fixtures::getSampleItems in Examples for Developers 8

Same name and namespace in other branches
  1. 3.x modules/tabledrag_example/src/Fixtures.php \Drupal\tabledrag_example\Fixtures::getSampleItems()

Returns array of sample records for demo purposes.

Return value

array Array of sample records.

See also

\Drupal\tabledrag_example\Form\TableDragExampleResetForm::submitForm()

tabledrag_example_install()

2 calls to Fixtures::getSampleItems()
TableDragExampleResetForm::submitForm in tabledrag_example/src/Form/TableDragExampleResetForm.php
Form submission handler.
tabledrag_example_install in tabledrag_example/tabledrag_example.install
Implements hook_install().

File

tabledrag_example/src/Fixtures.php, line 19

Class

Fixtures
Provides sample data for module's examples.

Namespace

Drupal\tabledrag_example

Code

public static function getSampleItems() {
  return [
    [
      'name' => 'Item One',
      'description' => 'The first item',
      'itemgroup' => 'Group1',
    ],
    [
      'name' => 'Item Two',
      'description' => 'The second item',
      'itemgroup' => 'Group1',
    ],
    [
      'name' => 'Item Three',
      'description' => 'The third item',
      'itemgroup' => 'Group1',
    ],
    [
      'name' => 'Item Four',
      'description' => 'The fourth item',
      'itemgroup' => 'Group2',
    ],
    [
      'name' => 'Item Five',
      'description' => 'The fifth item',
      'itemgroup' => 'Group2',
    ],
    [
      'name' => 'Item Six',
      'description' => 'The sixth item',
      'itemgroup' => 'Group2',
    ],
    [
      'name' => 'Item Seven',
      'description' => 'The seventh item',
      'itemgroup' => 'Group3',
    ],
    [
      'name' => 'Item Eight',
      'description' => 'The eighth item',
      'itemgroup' => 'Group3',
    ],
    [
      'name' => 'Item Nine',
      'description' => 'The ninth item',
      'itemgroup' => 'Group3',
    ],
    [
      'name' => 'Item Ten',
      'description' => 'The tenth item',
      'itemgroup' => 'Group4',
    ],
    [
      'name' => 'Item Eleven — A Root Node',
      'description' => 'This item cannot be nested under a parent item',
      'itemgroup' => 'Group4',
    ],
    [
      'name' => 'Item Twelve — A Leaf Item',
      'description' => 'This item cannot have child items',
      'itemgroup' => 'Group4',
    ],
  ];
}