/* (non-PHPdoc)
@see common_persistence_sql_pdo_Driver::getSchemaManager()
359971
public function getSchemaManager(){
        if($this->schemamanger == null){
            $this->schemamanger = new common_persistence_sql_pdo_pgsql_SchemaManager($this);
        }
        return $this->schemamanger;
    }
480261
public function getSchemaData()
    {
        $defaults = $this->getSchemaDataDefaults();
        return array_replace_recursive($defaults, array_intersect_key($this->schemaData, $defaults));
    }
575234
protected function getSchema($connectionName = null)
    {
        $connectionName = $connectionName === null ? $this->connectionName : $connectionName;

        /** @var \Doctrine\DBAL\Schema\AbstractSchemaManager $schema */
        $schema = app('db')->connection($connectionName)->getDoctrineSchemaManager();
        // For MySQL
        $schema->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
        // For Sqlite
        $schema->getDatabasePlatform()->registerDoctrineTypeMapping('long', 'integer');
        $schema->getDatabasePlatform()->registerDoctrineTypeMapping('bit', 'boolean');

        return $schema;
    }
322101
public function get_manager() {
        global $CFG;

        if (!$this->database_manager) {
            require_once($CFG->libdir.'/ddllib.php');

            $classname = $this->get_dbfamily().'_sql_generator';
            require_once("$CFG->libdir/ddl/$classname.php");
            $generator = new $classname($this, $this->temptables);

            $this->database_manager = new database_manager($this, $generator);
        }
        return $this->database_manager;
    }
864914
@Override
    public SchemaManager getSchemaManager(Map<String, Object> puProperties)
    {
        if (schemaManager == null)
        {
            initializePropertyReader();
            externalProperties.put(CassandraConstants.CQL_VERSION, CassandraConstants.CQL_VERSION_3_0);
            externalProperties.put(
                    CassandraConstants.THRIFT_PORT,
                    externalProperties.get(CassandraConstants.THRIFT_PORT) != null ? externalProperties
                            .get(CassandraConstants.THRIFT_PORT) : "9160");
            schemaManager = new CassandraSchemaManager(this.getClass().getName(), externalProperties, kunderaMetadata);
        }
        return schemaManager;

    }
847030
public function getSchemaBuilder()
    {
        $parentBuilder = parent::getSchemaBuilder();

        // add a blueprint resolver closure that returns the custom blueprint
        $parentBuilder->blueprintResolver(function ($table, $callback) {
            return new Blueprint($table, $callback);
        });

        return $parentBuilder;
    }
277669
protected static function getSchema()
    {
        static $cache = null;
        if (!isset($cache)) {
            $schemaFile = __DIR__.'/doctrine-xml-0.5.xsd';
            $s = (is_file($schemaFile) && is_readable($schemaFile)) ? @file_get_contents($schemaFile) : false;
            if ($s === false) {
                throw new Exception('Failed to load the schema file '.$schemaFile);
            }
            $cache = $s;
        }

        return $cache;
    }
1059902
protected function getTransactionManager()
    {
        if (!$this->transactionManager) {
            // PDOConnector providers this
            if ($this->connector instanceof TransactionManager) {
                $this->transactionManager = new NestedTransactionManager($this->connector);
            // Direct database access does not
            } else {
                $this->transactionManager = new NestedTransactionManager(new MySQLTransactionManager($this));
            }
        }
        return $this->transactionManager;
    }
656929
function getSchema()
    {
        # Database structure
        $schema = 'CREATE TABLE IF NOT EXISTS ' . $this->table . ' (';
        $sep = PHP_EOL;

        foreach($this->schema as $fld) {
            $schema .= $sep . $fld;
            $sep = ', ' . PHP_EOL;
        }

        $schema .= PHP_EOL . ');' . PHP_EOL;

        # Indecies
        foreach($this->indecies as $index) {
            foreach($index as $type=>$field) {
                $type = strtolower($type);
                switch ($type) {
                    case 'u':
                    case 'unique':
                        $schema .=  'CREATE UNIQUE INDEX ';
                        break;
                    case 'i':
                    case 'index':
                    default:
                        $schema .=  'CREATE INDEX ';
                }
                $schema .=
                    "{$this->table}_{$field}_{$type}" .
                    ' ON ' . $this->table . '(' . $field . ');' . PHP_EOL;
            }
        }

        return $schema;
    }
923839
public function getSchemaCollection()
    {
        if ($this->_schemaCollection !== null) {
            return $this->_schemaCollection;
        }

        if (!empty($this->_config['cacheMetadata'])) {
            return $this->_schemaCollection = new CachedCollection($this, $this->_config['cacheMetadata']);
        }

        return $this->_schemaCollection = new SchemaCollection($this);
    }
1138294
private function getSchema(): ?SchemaInterface
    {
        if ($this->schema !== null) {
            return $this->schema;
        }

        if (!empty($this->options['schema']) && $this->options['schema'] instanceof SchemaInterface) {
            $this->schema = $this->options['schema'];
            return $this->schema;
        }

        if (!empty($this->provider) && !empty($this->provider['class']) && !empty($this->provider['name'])) {

            //TODO this is a dirty way of receiving the service
            $provider = null;
            if ($this->serviceManager->has($this->provider['class'])) {
                $provider = $this->serviceManager->get($this->provider['class']);
            }

            if (empty($provider)) {
                foreach (\array_keys($this->serviceManager->getServiceManagerConfig()->getSubManagers()) as $subManager) {
                    if ($this->serviceManager->get($subManager)->has($this->provider['class'])) {
                        $provider = $this->serviceManager->get($subManager)->get($this->provider['class']);
                        break;
                    }
                }
            }

            if (!($provider instanceof SchemaProviderInterface)) {
                throw new \Exception("provider must implement " . SchemaProviderInterface::class);
            }

            $this->schema = $provider->provideSchema(
                $this->provider['name'],
                $this->builder,
                $this->provider['options']
            );
            return $this->schema;
        }

        throw new \Exception("Cant initialize without schema");
    }
1125207
public function getSchemaParser()
    {
        if (!$this->schemaParser) {
            $this->schemaParser = SchemaParserFactory::get(
                $this->config->getSchemaFormat(),
                $this->config->getSchemaFolder()
            );
        }

        return $this->schemaParser;
    }
530373
public function getSchemaFactory()
    {
        if (!$this->schemaFactory) {
            $this->schemaFactory = new LdapObjectSchemaFactory(
                $this->getCache(), $this->getSchemaParser(), $this->config->getEventDispatcher()
            );
        }

        return $this->schemaFactory;
    }
682708
public function getSchemaConfig($include_options = null)
    {
        if ($include_options === null) {
            $include_options = $this->include_options;
        }
        $schema = $this->schemaSignature;
        if ($this->useLocalCaching && in_array($schema, self::$fullyCachedSchemas)) {
            return self::$localCache[$schema];
        }

        $config = $this->driver->getSchemaConfig($table = null, $include_options);
        if (count($config['tables']) == 0) {
            throw new Exception\SchemaNotFoundException(__METHOD__ . " Error: schema '{$schema}' not found or without any table or view");
        }
        if ($this->useLocalCaching) {
            self::$localCache[$schema] = $config;
            self::$fullyCachedSchemas[] = $schema;
        }

        return $config;
    }
1022514
protected function getTable()
    {
        $schema = $this->connection->getSchemaManager();

        if (!$schema->tablesExist($this->table)) {
            $schema->createTable($this->getTableDefinition());
        }

        return $this->getConnection()->createQueryBuilder();
    }
374078
public function setSchemaManager(DBSchemaManager $schemaManager)
    {
        $this->schemaManager = $schemaManager;

        if ($this->schemaManager) {
            $this->schemaManager->setDatabase($this);
        }
    }
932332
public function getEntityTypeManager() {
    if (empty($this->entityTypeManager)) {
      $this->entityTypeManager = \Drupal::entityTypeManager();
    }
    return $this->entityTypeManager;
  }