You are here

protected function NestedSetStorage::ensureTableExists in Entity Reference Hierarchy 3.x

Same name and namespace in other branches
  1. 8.2 src/Storage/NestedSetStorage.php \Drupal\entity_hierarchy\Storage\NestedSetStorage::ensureTableExists()

Creates the table if required.

1 call to NestedSetStorage::ensureTableExists()
NestedSetStorage::__call in src/Storage/NestedSetStorage.php

File

src/Storage/NestedSetStorage.php, line 134

Class

NestedSetStorage
Wraps the library nested set implementation with JIT table creation.

Namespace

Drupal\entity_hierarchy\Storage

Code

protected function ensureTableExists() {
  try {
    $this->schema
      ->create();
    return TRUE;
  } catch (\Exception $e) {
    return FALSE;
  }
}