You are here

public function NestedSetStorageFactory::fromTableName in Entity Reference Hierarchy 3.x

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

Gets a new nested set storage handler for the given table.

@todo Remove this in favour of derivative argument plugins?

Parameters

string $table_name: Table name.

Return value

\Drupal\entity_hierarchy\Storage\NestedSetStorage Nested set for given field.

1 call to NestedSetStorageFactory::fromTableName()
NestedSetStorageFactory::get in src/Storage/NestedSetStorageFactory.php
Gets a new nested set storage handler.

File

src/Storage/NestedSetStorageFactory.php, line 85

Class

NestedSetStorageFactory
Defines a factory for creating a nested set storage handler for hierarchies.

Namespace

Drupal\entity_hierarchy\Storage

Code

public function fromTableName($table_name) {
  if (!isset($this->cache[$table_name])) {
    $this->cache[$table_name] = new NestedSetStorage($this->connection, $table_name, $this->logger);
  }
  return $this->cache[$table_name];
}