function tabledrag_example_install
Implements hook_install().
Populates newly created database table with fixtures for all module's examples. This hook executed after hook_schema() tables are created by core.
See also
\Drupal\Core\Extension\ModuleInstaller::install()
Related topics
File
- 
              modules/tabledrag_example/ tabledrag_example.install, line 82 
Code
function tabledrag_example_install() {
  /** @var \Drupal\Core\Database\Connection $connection */
  $connection = \Drupal::database();
  $rows = Fixtures::getSampleItems();
  foreach ($rows as $row) {
    $connection->insert('tabledrag_example')
      ->fields($row)
      ->execute();
  }
}