Get the corresponding Tablegateway of the given stream name

@param StreamName $streamName

@return TableGateway
765561
protected function getTablegateway(StreamName $streamName)
    {
        if (!isset($this->tableGateways[$streamName->toString()])) {
            $this->tableGateways[$streamName->toString()] = new TableGateway($this->getTable($streamName), $this->dbAdapter);
        }

        return $this->tableGateways[$streamName->toString()];
    }
1003663
public function readString(Stream $stream)
    {
        $length = $this->readVarint($stream);
        $string = $stream->read($length);

        return $string;
    }
1009418
protected function getContentType($fileName)
    {
        // Just grabbing the extension
        $extension = strtolower(substr($fileName, strrpos($fileName, '.') + 1));
        if (isset($this->extensionMap[$extension])) {
            return $this->extensionMap[$extension];
        }

        return 'application/octet-stream';
    }
247078
public function getNodeFrom(StreamInterface $stream)
    {
        while ($this->prepareChunk($stream)) {
            // What's our next course of action?
            if ($this->nextAction === self::FIND_OPENING_TAG_ACTION) {
                // Try to find an opening tag
                $positionInBlob = $this->getOpeningTagPos();

                if ($positionInBlob !== false) {
                    // We found it, start salvaging
                    $this->firstNodeFound = true;

                    if ($this->options["extractContainer"] && $this->preCapture) {
                        $this->containerXml .= substr($this->workingBlob, 0, $positionInBlob);
                        $this->preCapture = false;
                    }


                    $this->startSalvaging($positionInBlob);

                    // The next course of action will be to find a closing tag
                    $this->nextAction = self::FIND_CLOSING_TAG_ACTION;
                }
            }
            
            if ($this->nextAction === self::FIND_CLOSING_TAG_ACTION) {
                // Try to find a closing tag
                $positionInBlob = $this->getClosingTagPos();
                if ($positionInBlob !== false) {
                    // We found it, we now have a full node to flush out
                    $this->flush($positionInBlob);

                    // The next course of action will be to find an opening tag
                    $this->nextAction = self::FIND_OPENING_TAG_ACTION;

                    // Get the flushed node and make way for the next node
                    $flushed = $this->flushed;
                    $this->flushed = "";

                    return $flushed;
                }
            }
        }

        if ($this->options["extractContainer"]) {
            $this->containerXml .= $this->workingBlob;
        }

        return false;
    }
1087592
public function openStreamFeed($streamName, EntryEmbedMode $embedMode = null): StreamFeed
    {
        $url = $this->getStreamUrl($streamName);

        return $this->readStreamFeed($url, $embedMode);
    }
928046
public function getTableByPhpName($phpName)
    {
        if ('\\' !== $phpName[0]) {
            $phpName = '\\' . $phpName;
        }
        if (isset($this->tablesByPhpName[$phpName])) {
            return $this->tablesByPhpName[$phpName];
        }

        if (class_exists($tmClass = $phpName . 'TableMap')) {
            $this->addTableFromMapClass($tmClass);

            return $this->tablesByPhpName[$phpName];
        }

        if (class_exists($tmClass = substr_replace($phpName, '\\Map\\', strrpos($phpName, '\\'), 1) . 'TableMap')
            || class_exists($tmClass = '\\Map\\' .$phpName . 'TableMap')) {
            $this->addTableFromMapClass($tmClass);

            if (isset($this->tablesByPhpName[$phpName])) {
                return $this->tablesByPhpName[$phpName];
            }

            if (isset($this->tablesByPhpName[$phpName])) {
                return $this->tablesByPhpName[$phpName];
            }
        }

        throw new TableNotFoundException(sprintf('Cannot fetch TableMap for undefined table phpName: %s.', $phpName));
    }
513905
public function getResourceStream(DatabaseResource $resource): StreamInterface
    {
        switch ($this->conn->getDriverName()) {
            case DB::DRIVER_MYSQL:
            case DB::DRIVER_SQLITE:
                $stmt = $this->conn->prepare("SELECT `data` FROM `#__webdav_file_data` WHERE `resource_id` = :id ORDER BY `resource_id`, `chunk`");
                $stmt->bindValue('id', $resource->getIdentifier());
                $stmt->transform('data', new StreamTransformer());
                
                return new DatabaseOutputStream($stmt);
        }
        
        $stmt = $this->conn->prepare("SELECT `data` FROM `#__webdav_file_data` WHERE `resource_id` = :id");
        $stmt->bindValue('id', $resource->getIdentifier());
        $stmt->transform('data', new StreamTransformer());
        $stmt->execute();
        
        return $stmt->fetchNextColumn('data');
    }
178831
protected function extractTableName($stream)
    {
        if ($stream->getNextExpected(T_WHITESPACE) === null) {
            return false;
        }

        if ($stream->getNextExpected(T_VARIABLE) === null) {
            return false;
        }

        if ($stream->getCurrentText() != '$table') {
            return false;
        }

        if ($stream->getNextExpectedTerminated(['=', T_WHITESPACE], [T_CONSTANT_ENCAPSED_STRING]) === null) {
            return null;
        }

        $tableName = $stream->getCurrentText();
        $tableName = trim($tableName, '\''); 
        $tableName = trim($tableName, '"'); 

        return $tableName;
    }
502217
public function getSqlFileByName($fileName)
    {
        $sqlFinder = $this->getFinder();

        $files = $sqlFinder->files()
            ->in($this->sqlFilesDir)
            ->name($fileName)
        ;

        if ($files->count() !== 1) {
            throw new RuntimeException('cannot find File:' . $fileName);
        }

        foreach ($files as $file){
            return $file;
        }
    }
847631
private function resolveEndpoint($queueName)
    {
        if (isset($this->queueMap[$queueName])) {
            return $this->queueMap[$queueName];
        }

        return '/_ah/queue/'.$queueName;
    }
576075
private function getStream($filename): StreamInterface
    {
        if ($filename instanceof StreamableInterface) {
            return $filename->getStream();
        }

        if ($filename instanceof StreamInterface) {
            return $filename;
        }

        if (is_resource($filename)) {
            return new Stream($filename, 'r');
        }

        if (!$this->files->isFile($filename)) {
            throw new ResponseException("Unable to allocate response body stream, file does not exist");
        }

        return new Stream(fopen($filename, 'r'));
    }
1190736
public function makeRaw(string $connectionName = ''): RawQueryBuilder
    {
        $connection = $this->provideConnection($connectionName);
        $statementBuilder = new RawStatementBuider;
        return new RawQueryBuilder($connection, $statementBuilder);
    }
357660
public function getTransport($transportName)
    {
        if (empty($this->transport[$transportName])) {
            throw new InvalidArgumentException(sprintf('Transport %s not found', $transportName));
        }

        return $this->transport[$transportName];
    }
827653
private function getQueueConsumer($queueName)
    {
        if (false == array_key_exists($queueName, $this->consumers)) {
            $queue = $this->context->createQueue($queueName);

            $this->consumers[$queueName] = $this->context->createConsumer($queue);
        }

        return $this->consumers[$queueName];
    }
285584
private function findTableByName($tableName)
    {
        $tables = $this->getSchemaManager()->listTables();
        foreach ($tables as $table) {
            if ($table->getName() === $tableName) {
                return $table;
            }
        }

        throw new \InvalidArgumentException(\sprintf('Table with name "%s" does not exists.', $tableName));
    }
836019
public function getOwningTable($fieldName)
    {
        if (isset($this->owningTableMap[$fieldName])) {
            return $this->owningTableMap[$fieldName];
        }

        switch (true) {
            case isset($this->class->associationMappings[$fieldName]['inherited']):
                $cm = $this->em->getClassMetadata($this->class->associationMappings[$fieldName]['inherited']);
                break;

            case isset($this->class->fieldMappings[$fieldName]['inherited']):
                $cm = $this->em->getClassMetadata($this->class->fieldMappings[$fieldName]['inherited']);
                break;

            default:
                $cm = $this->class;
                break;
        }

        $tableName          = $cm->getTableName();
        $quotedTableName    = $this->quoteStrategy->getTableName($cm, $this->platform);

        $this->owningTableMap[$fieldName] = $tableName;
        $this->quotedTableMap[$tableName] = $quotedTableName;

        return $tableName;
    }
1305024
public function extract(
        Name $name,
        StreamInterface $arguments,
        Argument $argument
    ): StreamInterface {
        try {
            return $this
                ->get($name)
                ->extract($name->withoutRoot(), $arguments, $argument);
        } catch (ReferenceNotFound $e) {
            throw new ReferenceNotFound((string) $name, 0, $e);
        }
    }