Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
novicell/content_hierarchy / content_hierarchy.install
Size: Mime:
<?php

/**
 * Implements hook_schema().
 */
function content_hierarchy_schema() {
  $schema['content_hierarchy'] = [
    'description' => 'Content hierarchy storage.',
    'fields' => [
      'content_id' => [
        'description' => 'ID for content.',
        'type' => 'serial',
        'not null' => TRUE,
      ],
      'source' => [
        'description' => 'Source for the this content',
        'type' => 'varchar',
        'length' => 12,
        'not null' => TRUE,
        'default' => 'entity'
      ],
      'type' => [
        'description' => 'The type or bundle of this content',
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
      ],
      'entity_id' => [
        'description' => 'Entity ID for this content',
        'type' => 'int',
        'unsigned' => TRUE
      ]
    ],
    'primary key' => ['content_id']
  ];

  $schema['content_hierarchy_placement'] = [
    'description' => 'Content hierarchy storage.',
    'fields' => [
      'content_id' => [
        'description' => 'ID for content.',
        'type' => 'int',
        'not null' => TRUE,
      ],
      'langcode' => [
        'description' => 'The language code used for this content',
        'type' => 'varchar',
        'length' => '12',
        'not null' => TRUE,
        'default' => 'und',
      ],
      'parent_id' => [
        'description' => 'Parent ID for this content',
        'type' => 'int'
      ],
      'weight' => [
        'description' => 'weight for this content',
        'type' => 'int'
      ],
      'root' => [
        'description' => 'Whether the content is a root',
        'type' => 'int',
        'size' => 'tiny',
        'default' => 0
      ],
      'excluded' => [
        'description' => 'Whether the content is excluded',
        'type' => 'int',
        'size' => 'tiny',
        'default' => 0
      ]
    ],
    'primary key' => ['content_id', 'langcode'],
    'indexes' => [
      'langcode' => [
        'langcode',
      ],
      'parent_id' => [
        'parent_id',
      ],
    ],
  ];

  return $schema;
}

function content_hierarchy_install() {

}

function content_hierarchy_uninstall() {

}

function content_hierarchy_update_8001() {
  $configFactory = \Drupal::configFactory();
  $configFactory->getEditable('content_hierarchy.hierarchy_settings')->clear('overview_type');
}

function content_hierarchy_update_8002() {
  $configFactory = \Drupal::configFactory();
  $config = $configFactory->getEditable('content_hierarchy.hierarchy_settings');

  $config->set('override_content_menu_item', 1);
  $config->save();
}