Returns the database table name or sets a new one.

@deprecated 3.4.0 Use setTable()/getTable() instead.
@param string|null $table the new table name
@return string
973409
public function table($table = null)
    {
        deprecationWarning(
            get_called_class() . '::table() is deprecated. ' .
            'Use setTable()/getTable() instead.'
        );
        if ($table !== null) {
            $this->setTable($table);
        }

        return $this->getTable();
    }
901652
public function getPrefix($table = null)
    {
        $prefix = $this->_socket->getPrefix();

        return $table ? $prefix.$table : $prefix;
    }
1260139
private function determineTableName()
    {
        $annotations = $this->inspector->getClassAnnotations();
        $name = self::parseTableName($this->entity);
        if ($annotations->hasAnnotation('@table')) {
            $name = $annotations->getAnnotation('@table')->getValue();
        }
        return $name;
    }
858092
protected function resolveTableName($table)
    {
        if (! Str::contains($table, '\\') || ! class_exists($table)) {
            return $table;
        }

        $model = new $table;

        if (! $model instanceof Model) {
            return $table;
        }

        if ($model instanceof Pivot) {
            $this->using($table);
        }

        return $model->getTable();
    }
531301
public function getTableDefinition($table)
    {
        foreach ($this->getTableDefinitions() as $definition) {
            if ($definition->getName() === $table) {
                return $definition;
            }
        }

        return null;
    }
6118
public function tableExists($table)
    {
        $database = null;
        if (($pos = strpos($table, '.')) !== false) {
            $database = substr($table, 0, $pos);
            $table = substr($table, $pos + 1);
        } else {
            $table = $this->buildRealTableName($table, false);
        }
        
        $tables = $this->getTables($database);
        
        return in_array($table, $tables);
    }
1122504
public function getTableInfo($table=null)
    {
        if (!$table) {
            if (!isset($this['fields'])) {
                $table = $this->getTableName();
                $info = $this->getDb()->getTableInfo($table);
                if ($info) $this->setOption($info);
            }
            return $this->options;
        } else {
            return $this->getDb()->getTableInfo($table);
        }
    }
932744
protected function getTableKey($table) {
        if (empty(static::$tableKeys)) {
            $this->loadTableKeys();
        }

        return isset(static::$tableKeys[$table]) ? static::$tableKeys[$table] : static::$tableKeys['__default__'];
    }
886742
public function getTableName()
    {
        if (null == $this->tableName) {
            $this->tableName = $this->determineTableName();
        }
        return $this->tableName;
    }
352574
protected function getDatabaseVisionClassName($database, $table)
    {
        return INTERNAL_ACCESS . ( strtolower($database) === strtolower($this->defaultDatabaseName) ? NULL : ucfirst($database) ) . ucfirst($table) . 'Vision';
    }
399045
final public function dropTable($table = null)
    {
        $table = $this->getTable($table);

        return $this->db->dropTable($table, true)
                        ->execute();
    }
57538
public function getCreateTable($table)
    {
        $tableName = $this->validTableName($table['table']);
        $sql = '';
        foreach ($table['fields'] as $field => $value) {
            $sql .= ($sql === '') ? '' : ', ';
            $sql .= '`' . $field . '` ' . $value['type'];
            if (isset($value['autoincrement']) && $value['autoincrement']) {
                $sql .= ' AUTO_INCREMENT PRIMARY KEY';
            }
            if (isset($value['primary']) && $value['primary']) {
                $sql .= ' PRIMARY KEY';
            }
        }

        return 'CREATE TABLE ' . $tableName . '(' . $sql . ')';
    }
133216
public function getTable($tablename) {
        $i = $this->findTableInArray($tablename);
        if ($i !== null) {
            return $this->tables[$i];
        }
        return null;
    }
438007
public function table($table): object
    {
        if ($table instanceof Closure) {
            $sql   = $this->getSQLfromClosure($table);
            $table = '(' . $sql . ') as lin' . $this->tableCounter++;
        } else {
            $table = trim($table);
        }
        if (empty($this->container[$this->id]['s']['table'])) {
            $this->container[$this->id]['s']['table'] = " $table";
        } else {
            $this->container[$this->id]['s']['table'] .= ", $table";
        }

        return $this;
    }
336124
public function getTableName()
    {
        if (is_null($this->_tableName)) {
            $this->_tableName = $this->getDescriptor()->getEntity()
                ->getTableName();
        }
        return $this->_tableName;
    }
355545
protected function getTable(): Table
    {
        if ($this->table === null) {
            $this->table = new Table($this->output);
        }
        return $this->table;
    }
531899
protected function sql( $table = self::DEFAULT_TABLE )
    {
        if ( self::DEFAULT_TABLE === $table )
        {
            if ( null === $this->sql )
            {
                $this->sql = new Sql(
                    $this->getDbAdapter(),
                    $this->getTableName()
                );
            }

            return $this->sql;
        }

        return new Sql(
            $this->getDbAdapter(),
            $table
        );
    }