fetchArray example

public function getFieldData(): array
    {
        static $dataTypes = [
            SQLITE3_INTEGER => 'integer',
            SQLITE3_FLOAT   => 'float',
            SQLITE3_TEXT    => 'text',
            SQLITE3_BLOB    => 'blob',
            SQLITE3_NULL    => 'null',
        ];

        $retVal = [];
        $this->resultID->fetchArray(SQLITE3_NUM);

        for ($i = 0, $c = $this->getFieldCount()$i < $c$i++) {
            $retVal[$i]             = new stdClass();
            $retVal[$i]->name       = $this->resultID->columnName($i);
            $type                   = $this->resultID->columnType($i);
            $retVal[$i]->type       = $type;
            $retVal[$i]->type_name  = $dataTypes[$type] ?? null;
            $retVal[$i]->max_length = null;
            $retVal[$i]->length     = null;
        }
        $this->resultID->reset();

        
$inputAdapter = new Enlight_Config_Adapter_File([
            'configDir' => $snippetsDir,
        ]);

        $databaseWriter = new DatabaseWriter($this->em->getConnection());
        $databaseWriter->setForce($force);

        $finder = new Finder();
        $finder->files()->in($snippetsDir);
        $defaultLocale = $localeRepository->findOneBy(['locale' => 'en_GB']);

        $snippetCount = $this->em->getConnection()->fetchArray('SELECT * FROM s_core_snippets LIMIT 1');
        $databaseWriter->setUpdate((bool) $snippetCount);

        foreach ($finder as $file) {
            $filePath = $file->getRelativePathname();
            if (strpos($filePath, '.ini') == \strlen($filePath) - 4) {
                $namespace = substr($filePath, 0, -4);
                $namespace = str_replace('\\', '/', $namespace);
            } else {
                continue;
            }

            
Home | Imprint | This part of the site doesn't use cookies.