monster_menus-9.0.x-dev/modules/mm_workflow_access/mm_workflow_access.install
modules/mm_workflow_access/mm_workflow_access.install
<?php
/**
* @file
* Installer for mm_workflow_access
*/
/**
* Implements hook_schema().
*/
function mm_workflow_access_schema() {
$schema['mm_workflow_access'] = [
'fields' => [
'sid' => [
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
],
'mode' => [
'type' => 'varchar',
'length' => '1',
'not null' => TRUE,
],
'gid' => [
'type' => 'int',
'not null' => TRUE,
'disp-width' => '11',
],
],
'primary key' => ['sid', 'mode', 'gid'],
'foreign keys' => [
'mm_tree' => [
'table' => 'mm_tree',
'columns' => [
'gid' => 'mmtid',
],
],
],
'description' => 'Workflow permissions via MM groups',
];
return $schema;
}
/**
* Implements hook_mm_verify_integrity()
*/
function mm_workflow_access_mm_verify_integrity() {
return ['MM Workflow Access' => [
(string) t('mm_workflow_access.gid refers to missing mm_tree.mmtid') =>
"{mm_workflow_access} x LEFT JOIN {mm_tree} t ON t.mmtid=x.gid WHERE x.gid>0 AND t.mmtid IS NULL",
]];
}
