X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd8%2Finstall.twig;fp=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd8%2Finstall.twig;h=aa441fc19406006553b0cfddfdc8d6f85b64c4ba;hp=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/install.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/install.twig new file mode 100644 index 000000000..aa441fc19 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/install.twig @@ -0,0 +1,96 @@ + 'Table description.', + 'fields' => [ + 'id' => [ + 'type' => 'serial', + 'not null' => TRUE, + 'description' => 'Primary Key: Unique record ID.', + ], + 'uid' => [ + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'description' => 'The {users}.uid of the user who created the record.', + ], + 'status' => [ + 'description' => 'Boolean indicating whether this record is active.', + 'type' => 'int', + 'unsigned' => TRUE, + 'not null' => TRUE, + 'default' => 0, + 'size' => 'tiny', + ], + 'type' => [ + 'type' => 'varchar_ascii', + 'length' => 64, + 'not null' => TRUE, + 'default' => '', + 'description' => 'Type of the record.', + ], + 'created' => [ + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'description' => 'Timestamp when the record was created.', + ], + 'data' => [ + 'type' => 'blob', + 'not null' => TRUE, + 'size' => 'big', + 'description' => 'The arbitrary data for the item.', + ], + ], + 'primary key' => ['id'], + 'indexes' => [ + 'type' => ['type'], + 'uid' => ['uid'], + 'status' => ['status'], + ], + ]; + + return $schema; +} + +/** + * Implements hook_requirements(). + */ +function {{ machine_name }}_requirements($phase) { + $requirements = []; + + if ($phase == 'runtime') { + $value = mt_rand(0, 100); + $requirements['{{ machine_name }}_status'] = [ + 'title' => t('{{ name }} status'), + 'value' => t('{{ name }} value: @value', ['@value' => $value]), + 'severity' => $value > 50 ? REQUIREMENT_INFO : REQUIREMENT_WARNING, + ]; + } + + return $requirements; +}