@param SchemaQName $qname

@return NodeMapper
760394
final public function getNodeMapper(SchemaQName $qname): NodeMapper
    {
        $key = $qname->toString();

        if (isset($this->mappers[$key])) {
            return $this->mappers[$key];
        }

        if (isset($this->types[$key], $this->types[$key]['mapper_class'])) {
            $class = $this->types[$key]['mapper_class'];
        } else {
            $class = $this->types['default']['mapper_class'];
        }

        if (isset($this->mappers[$class])) {
            return $this->mappers[$key] = $this->mappers[$class];
        }

        return $this->mappers[$key] = $this->mappers[$class] = new $class;
    }
101828
public function createNativeNamedQuery($queryName)
    {
        $queryMapping   = $this->_class->getNamedNativeQuery($queryName);
        $rsm            = new Query\ResultSetMappingBuilder($this->_em);
        $rsm->addNamedNativeQueryMapping($this->_class, $queryMapping);

        return $this->_em->createNativeQuery($queryMapping['query'], $rsm);
    }
876098
public function getMapper($fqcn)
    {
        if (!isset($this->mappers[$fqcn])) {
            $this->mappers[$fqcn] = $this->createMapper($fqcn);
        }

        return $this->mappers[$fqcn];
    }
363446
public static function fromQName( $qn )
	{
		$qname = new QNameValue();
		$qname->LocalName = $qn->localName;
		$qname->Prefix = $qn->prefix;
		$qname->NamespaceUri = $qn->namespaceURI;

		if ( strlen( $qn->localName ) == 0 ||
			 ! preg_match( "/^" . NameValue::$ncName . "$/u", $qn->localName ) ||
			 ( strlen( $qn->prefix ) != 0 && ! preg_match( "/^" . NameValue::$ncName . "$/u", $qn->prefix ) )
		)
		{
			throw XPath2Exception::withErrorCodeAndParam( "FOCA0002", Resources::FOCA0002, $qn->__toString() );
		}

		return $qname;
	}
1331064
public function getSimpleTypesFromUnion( $qname )
	{
		$name = $qname instanceof QName ? "{$qname->prefix}:{$qname->localName}" : $qname;

		while (true)
		{
			if ( ! $this->hasType( $name ) ) return array();

			$type = $this->getType( $name );
			if ( isset( $type['restrictionType'] ) && $type['restrictionType'] == 'union' )
			{
				return $type['types'];
			}

			if ( ! isset( $type['parent'] ) ) return array();
			$name = $type['parent'];

		}
	}
56050
public function getIndex($indexName)
    {
        $indexName = $this->normalizeIdentifier($indexName);
        if (! $this->hasIndex($indexName)) {
            throw SchemaException::indexDoesNotExist($indexName, $this->_name);
        }

        return $this->_indexes[$indexName];
    }
1201677
public function getTaxonomyForQName( $qname )
	{
		$prefix = $qname instanceof \QName
			? $qname->localName
			: strstr( $qname, ":", true );
		return $this->getTaxonomyForPrefix( $prefix );
	}
846803
public function getByID($queryID, $schemaKey = 'default')
    {
        $mapping = $this->getQueryMapping($schemaKey);

        return isset($mapping[$queryID]) ? $mapping[$queryID] : null;
    }
921379
public function getIdForQName( $qname )
	{
		if ( ! $qname instanceof QName )
		{
			$qname = qname( $qname, $this->getDocumentNamespaces() );
		}

		if ( ! $qname )
		{
			throw new Exception("Unable to resolve the QName '$qname'");
		}

		$taxonomy = $this->getTaxonomyForNamespace( $qname->namespaceURI );
		$taxonomy_element = $taxonomy->getElementByName( $qname->localName );
		return "{$taxonomy->getTaxonomyXSD()}#{$taxonomy_element['id']}";
	}
894486
public function getFieldMapping($fieldName)
    {
        if (!$this->hasField($fieldName)) {
            throw MappingException::fieldNotFound($this->name, $fieldName);
        }

        return $this->mappings[$fieldName];
    }
1176252
public static function getTablesNames(string $schemaName): array
  {
    $sql = sprintf("
select TABLE_NAME as table_name
from   information_schema.TABLES
where  TABLE_SCHEMA = %s
and    TABLE_TYPE   = 'BASE TABLE'
order by TABLE_NAME", self::$dl->quoteString($schemaName));

    return self::$dl->executeRows($sql);
  }
719513
public function getFieldXmlNode($fieldName)
    {
        return isset($this->fieldMappings[$fieldName]) ?
                $this->fieldMappings[$fieldName]['node'] : null;
    }
53984
public function getReferenceNodesByFqn(string $fqn)
    {
        return isset($this->referenceNodes) && isset($this->referenceNodes[$fqn]) ? $this->referenceNodes[$fqn] : null;
    }
614128
public function normalizePrefix( $qname )
	{
		$prefix = strstr( $qname, ":", true );
		if ( isset( $this->namespacePrefixMap[ $prefix ] ) )
		{
			$qname = str_replace( "$prefix:", "{$this->namespacePrefixMap[ $prefix ]}:", $qname );
		}

		return $qname;
	}
1024237
public static function getTablePrimaryKeys(string $schemaName, string $tableName): array
  {
    $sql = sprintf('
show index from %s.%s
where Key_name = \'PRIMARY\'',
                   $schemaName,
                   $tableName);

    return self::$dl->executeRows($sql);
  }
562333
protected static function schemaBuilder($name = null)
    {
        /**
         * @var $db \Illuminate\Database\DatabaseManager
         */
        $db = static::$app['db'];

        $builder = $db->connection($name)->getSchemaBuilder();

        $builder->blueprintResolver(function ($table, $callback) {
            return new Blueprint($table, $callback);
        });

        return $builder;
    }
1221715
public function schemaTemplate($schemaName)
    {
        return [
            'exists' => (new Query())
                ->select('nspname')
                ->from('pg_namespace')
                ->where('nspname = :value', [':value' => $schemaName])
                ->exists($this->db),
            'up' => "CREATE SCHEMA $schemaName",
            'down' => "DROP SCHEMA $schemaName",
        ];
    }