@static

@param $table

@return string
519378
public static function dumpTable($table)
    {
        $tokens = array();
        foreach ($table as $name => $value) {
            switch ($value[0]) {
                case 'D':
                    $val = $value[1]->n . 'E' . $value[1]->e;
                    break;
                case 'F':
                    $val = '(' . self::dumpTable($value[1]) . ')';
                    break;
                case 'T':
                    $val = date('Y-m-d H:i:s', $value[1]);
                    break;
                default:
                    $val = $value[1];
            }
            $tokens[] = $name . '=' . $val;
        }
        return implode(', ', $tokens);
    }
341537
final public function fetchColumnDefs(string $table) {
        $tableKey = strtolower($table);

        if (!empty($this->tables[$tableKey]['columns'])) {
            $this->tables[$tableKey]['columns'];
        } elseif ($this->tableNames !== null && !isset($this->tableNames[$tableKey])) {
            return null;
        }

        $columnDefs = $this->fetchColumnDefsDb($table);
        if ($columnDefs !== null) {
            $this->tables[$tableKey]['columns'] = $columnDefs;
        }
        return $columnDefs;
    }
1038090
protected function parseUpdateTable($table)
    {
        $table = $alias = $this->wrapTable($table);

        if (strpos(strtolower($table), '] as [') !== false) {
            $alias = '[' . explode('] as [', $table)[1];
        }

        return [$table, $alias];
    }
837786
final public function table($table) {
      $this->connection();
      if (func_num_args()>1)
         $table = func_get_args();
      else if(is_string($table))
         $table = [$table];
      
      $schema = '';
      if ($this->driver=='pgsql' && $this->schema)
         $schema = $this->schema ? $this->schema.'.' : '';

      $tmp_table = [];
      foreach($table as $table) {
         if (preg_match('/\./', $table)) {
            $tmp_table[] = $table;
         }
         else {
            $tmp_table[] = $schema.$table;
         }
      }

      $table = implode(",", $tmp_table);

      if ($this->extended) {
         if ( $this->table ) {
            $this->table = $schema.$this->table.",".$table;
         } else {
            $this->table = $table;
         }
      }
      else {
         $this->table = $table;
      }

      $this->find_first_data = $this->find_save_data = $this->find_delete_data = FALSE;

      $this->get_instance();
      return $this;
   }
164984
public function table($table)
    {
        if (is_string($table)) {
            if (strpos($table, ')')) {
                // 子查询
            } elseif (strpos($table, ',')) {
                $tables = explode(',', $table);
                $table  = [];

                foreach ($tables as $item) {
                    list($item, $alias) = explode(' ', trim($item));
                    if ($alias) {
                        $this->alias([$item => $alias]);
                        $table[$item] = $alias;
                    } else {
                        $table[] = $item;
                    }
                }
            } elseif (strpos($table, ' ')) {
                list($table, $alias) = explode(' ', $table);

                $table = [$table => $alias];
                $this->alias($table);
            }
        } else {
            $tables = $table;
            $table  = [];

            foreach ($tables as $key => $val) {
                if (is_numeric($key)) {
                    $table[] = $val;
                } else {
                    $this->alias([$key => $val]);
                    $table[$key] = $val;
                }
            }
        }
        $this->options['table'] = $table;

        return $this;
    }
1249989
public function wrapTable($table)
    {
        if (! $this->isExpression($table)) {
            return $this->wrapTableValuedFunction(parent::wrapTable($table));
        }

        return $this->getValue($table);
    }
1266800
public function renderName(TableStructure $table): string
    {
        if ($this->name === null || is_numeric($this->name)) {
            return "fk-{$table->name}-" . implode('-', $this->columns);
        }

        return $this->name;
    }
510529
final public function getLastPk($table = null)
    {
        if ($table === null) {
            $this->validateShortcutData();
            $table = static::getTableName();
        }

        return $this->db->select()
                        ->max($this->getPk())
                        ->from($table)
                        ->queryScalar();
    }
910462
public function convertToNamespaceAndClass ($table)
	{
		
		$arr		= explode ('_', $table);
		
		foreach ($arr as &$val)
		{
			$val = ucfirst (strtolower ($val));
		}
		
		array_unshift ($arr, 'Sonic', 'Model');
		
		$class		= array_pop ($arr);
		$namespace	= implode ('\\', $arr);
		
		return array ($namespace, $class);
		
	}
331949
protected static function getWithPrefix($table)
    {
        $prefix = static::$prefix;

        if (is_null($prefix) || empty($prefix)) {
            // If prefix is null, then no need to prepend a redundant _
            return $table;
        }

        return sprintf('%s_%s', $prefix, $table);
    }
385756
public function table($table)
    {
        $this->table = $table;
        $alias = $this->alias ?? $this->table;

        if (!in_array('`' . $table . '`.*', $this->select) && !in_array('`' . $alias . '`.*', $this->select)) {
            $this->select[] = '`' . $table . '`.*';
        }

        return $this;
    }
28267
final public function traceTableAlias($table)
    {

        if (is_array($table)) {
            foreach ($table as $t) {
                $this->traceTableAlias($t);
            }
            return;
        }
        // Does the string contain a comma?  If so, we need to separate
        // the string into discreet statements
        if (strpos($table, ',') !== FALSE) {
            return $this->traceTableAlias(explode(',', $table));
        }
        // if a table alias is used we can recognize it by a space
        if (strpos($table, " ") !== FALSE) {
            // if the alias is written with the AS keyword, remove it
            $table = preg_replace('/ AS /i', ' ', $table);

            // Grab the alias
            $table = trim(strrchr($table, " "));

            // Store the alias, if it doesn't already exist
            if (!in_array($table, $this->arrayAliasedTables)) {
                $this->arrayAliasedTables[] = $table;
            }
        }
    }
675217
private static function toPascalCase($table)
	{
		return str_repeat('_', strspn($table, '_')) . str_replace('_', '', ucwords($table, '_')) . str_repeat('_', strspn(strrev($table), '_'));
	}
947586
private static function table()
    {
        if (!isset(self::$tableMap[static::class])) {
            if (isset(static::$table)) {
                self::$tableMap[static::class] = static::$table;
            } else {
                self::$tableMap[static::class] = strtolower((new \ReflectionClass(static::class))->getShortName());
            }
        }
        return self::$tableMap[static::class];
    }
712934
public function get_table_definition($table) {
		$statement = $this->get_statement('DESC ' . $this->quote_identifier($table), []);
		$statement->execute();
		$result = $statement->fetch_assoc();
		return $result;
	}
531301
public function getTableDefinition($table)
    {
        foreach ($this->getTableDefinitions() as $definition) {
            if ($definition->getName() === $table) {
                return $definition;
            }
        }

        return null;
    }
117465
public function describeTable($table)
    {
        $table = explode('.', $table);
        if (count($table) > 1) {
            $schema = $table[0];
            $table = $table[1];
        } else {
            $schema = $this->getDefaultSchema();
            $table = $table[0];
        }

        return $this->getDescriptor()->describeTables($schema, [$table], true);
    }