Scanning database table

@param array $tables
493652
private function _scanningTable($tables)
    {
        $this->_scanner->stdout('Extracting mesages from ' . $tables['table'] . '.' . implode(',', $tables['columns']), Console::FG_GREEN);
        $query = new \yii\db\Query();
        $data = $query->select($tables['columns'])
            ->from($tables['table'])
            ->createCommand(Yii::$app->{$tables['connection']})
            ->queryAll();
        $category = $this->_getCategory($tables);
        foreach ($data as $columns) {
            $columns = array_map('trim', $columns);
            foreach ($columns as $column) {
                $this->_scanner->addLanguageItem($category, $column);
            }
        }
    }
701852
public function executeSql($queries)
    {
        $db = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

        if (is_array($queries) && !empty($queries)) {
            foreach ($queries as $query) {
                $query = trim($query);
                if (!empty($query)) {
                    $db->execute($query);
                }
            }
        }
    }
858972
private function executeQueries(array $queries)
    {
        foreach ($queries as $query) {
            $this->connection->prepare($query)->execute();
        }
    }
315639
private function getTableTags($tables, $rows)
    {
        $tags = [];
        $type = $this->reflector->getType();

        foreach ($tables as $table) {
            $isSpecific = (isset($rows[$table]) && !empty($rows[$table]));

            // These types of queries require a specific tag
            if (($type === Reflector::QUERY_TYPE_SELECT && $isSpecific) ||
                ($type === Reflector::QUERY_TYPE_UPDATE && !$isSpecific) ||
                ($type === Reflector::QUERY_TYPE_DELETE && !$isSpecific) ||
                ($type === Reflector::QUERY_TYPE_TRUNCATE)) {

                $tags[] = $this->prefix($table, self::PREFIX_TABLE_SPECIFIC);
            }

            // While these ones require an unspecific one
            if (($type === Reflector::QUERY_TYPE_SELECT && !$isSpecific) ||
                ($type === Reflector::QUERY_TYPE_UPDATE) ||
                ($type === Reflector::QUERY_TYPE_DELETE) ||
                ($type === Reflector::QUERY_TYPE_INSERT)) {

                $tags[] = $this->prefix($table, self::PREFIX_TABLE_UNSPECIFIC);
            }
        }

        return $tags;
    }
58038
protected function scanDatabase()
	{
		if ($this->isConnected()) {
			$tables = $this->doctrine->listTableNames();

			foreach ($tables as $table) {
				$schTable = $this->doctrine->listTableDetails($table);

				$this->tables[$table] = $this->getTableFields($schTable);
			}
		}
	}
312055
public function delete(array $tables = array())
    {
        $this->append(' DELETE ');

        if (!empty($tables)) {
            $tablesSequence = implode(', ', $tables);
            $this->append($tablesSequence);
        }

        return $this;
    }
1129147
public function tfoot(array $attributes = []): void
    {
        $this->tableArray[] = Tags::tfoot($this->trArray, $attributes);
        $this->trArray = [];
    }
947969
public function addDelete($tables)
    {
        if (is_array($tables)) {
            $this->delete = array_merge($this->delete, $tables);
        } elseif (!empty($tables)) {
            $this->delete[str_replace(array('"','`'), '', $tables)] = $tables;
        }
        return $this;
    }
20248
public function delete($tables = null)
    {
        if (null !== $tables) {
            $this->tables($tables);
        }
        $this->action = 'delete';
        return $this;
    }
1163303
public function removeExcludedTables(array $tables): array
    {
        if (!$tables) {
            return [];
        }

        $filteredTables = [];
        $excludedTables = array_merge(
            [$this->db->schema->getRawTableName($this->migrationTable)],
            $this->excludeTables
        );

        foreach ($tables as $table) {
            if (!in_array($table, $excludedTables, true)) {
                $filteredTables[] = $table;
            }
        }

        return $filteredTables;
    }
65629
public function setTables($tables) {
		foreach($tables as $key=>$value) {
			if (is_numeric($key)) {
				$this->tables[] = $value;
			}
			else {
				$this->tables[] = $key;
				$this->columns[$key] = $value;
			}
		}
		$this->cacheTables = true;
	}
211996
private function getTableData($tables)
    {
        $db = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster(\OxidEsales\Eshop\Core\DatabaseProvider::FETCH_MODE_ASSOC);

        $data = array();
        foreach ($tables as $table) {
            $data[$table] = array();

            $result = $db->select("SELECT * FROM `${table}`");
            if ($result && $result->count() > 0) {

                $rows = array();
                while (!$result->EOF) {
                    $rows[] = $result->fields;

                    $result->fetchRow();
                }
                $data[$table]["_sql_"] = $this->getInsertString($rows, $table);
            }
        }

        return $data;
    }
377649
private function executeTableShowHeader(array $columns): void
  {
    $separator = '+';
    $header    = '|';

    foreach ($columns as $column)
    {
      $separator .= str_repeat('-', $column['length'] + 2).'+';
      $spaces    = ($column['length'] + 2) - mb_strlen((string)$column['header']);

      $spacesLeft  = (int)floor($spaces / 2);
      $spacesRight = (int)ceil($spaces / 2);

      $fillerLeft  = ($spacesLeft>0) ? str_repeat(' ', $spacesLeft) : '';
      $fillerRight = ($spacesRight>0) ? str_repeat(' ', $spacesRight) : '';

      $header .= $fillerLeft.$column['header'].$fillerRight.'|';
    }

    echo "\n", $separator, "\n";
    echo $header, "\n";
    echo $separator, "\n";
  }
608232
private function createIndex(Table $table, array $columns)
    {
        if (count($columns) > 0) {
            $indexPrefix = "idx_" . RdsDeliveryExecutionService::TABLE_NAME . "_";

            // Index names are limited to 63 characters in PostgreSQL (64 in MySQL)
            $indexName = substr($indexPrefix . implode("_", $columns), 0, 63);

            $table->addIndex($columns, $indexName);
        }
    }
954351
public function table($tables)
    {
        if (!is_array($tables)) {
            // because a single table is converted to an array anyways,
            // this makes sense.
            $tables = func_get_args();
        }

        $instance = new static($this->connection, $this->getFetchMode());
        $tables = $this->addTablePrefix($tables, false);
        $instance->addStatement('tables', $tables);
        return $instance;
    }
211044
public function update($tables = null)
    {
        if (null !== $tables) {
            $this->tables($tables);
        }
        $this->action = 'update';
        return $this;
    }
45232
public function from($tables)
    {
        if (is_string($tables)) {
            $tables = $this->splitParts($tables);
        }
        foreach ($tables as $k => $table) {
            if ($alias = $this->matchAlias($table)) {
                $tables[$k] = $this->db->quoteTable($alias[0]) . ' AS ' . $this->db->quoteTable($alias[1]);
            } else {
                $tables[$k] = $this->db->quoteTable($table);
            }
        }

        $this->query['from'] = implode(', ', $tables);

        return $this;
    }