@param Table $table

@throws InvalidArgumentException

@return Database
494480
final public function removeTable(Table $table): Database
    {
        if (!$this->hasTable($table::getName())) {
            throw new InvalidArgumentException('Table '.$table::getName().' not exists');
        }

        unset($this->tables[$table::getName()]);

        return $this;
    }
547189
public function table($table)
    {
        $tables = is_array($table) ? $table : func_get_args();
        $this->_parts['table'] = $tables;
        return $this;
    }
609064
public function getCreateTableSQL(Table $table, $createFlags = self::CREATE_INDEXES)
    {
        if (!is_int($createFlags)) {
            $msg = "Second argument of CratePlatform::getCreateTableSQL() has to be integer.";
            throw new \InvalidArgumentException($msg);
        }

        if (count($table->getColumns()) === 0) {
            throw DBALException::noColumnsSpecifiedForTable($table->getName());
        }

        $tableName = $table->getQuotedName($this);
        $options = $table->getOptions();
        $options['uniqueConstraints'] = array();
        $options['indexes'] = array();
        $options['primary'] = array();

        if (($createFlags&self::CREATE_INDEXES) > 0) {
            foreach ($table->getIndexes() as $index) {
                /* @var $index Index */
                if ($index->isPrimary()) {
                    $platform = $this;
                    $options['primary'] = array_map(function ($columnName) use ($table, $platform) {
                        return $table->getColumn($columnName)->getQuotedName($platform);
                    }, $index->getColumns());
                    $options['primary_index'] = $index;
                } else if ($index->isUnique()) {
                    throw DBALException::notSupported("Unique constraints are not supported. Use `primary key` instead");
                } else {
                    $options['indexes'][$index->getName()] = $index;
                }
            }
        }

        $columnSql = array();
        $columns = array();

        foreach ($table->getColumns() as $column) {
            if (null !== $this->_eventManager &&
                $this->_eventManager->hasListeners(Events::onSchemaCreateTableColumn)) {

                $eventArgs = new SchemaCreateTableColumnEventArgs($column, $table, $this);
                $this->_eventManager->dispatchEvent(Events::onSchemaCreateTableColumn, $eventArgs);

                $columnSql = array_merge($columnSql, $eventArgs->getSql());

                if ($eventArgs->isDefaultPrevented()) {
                    continue;
                }
            }
            $columns[$column->getQuotedName($this)] = $this->prepareColumnData($column, $options['primary']);
        }

        if (null !== $this->_eventManager && $this->_eventManager->hasListeners(Events::onSchemaCreateTable)) {
            $eventArgs = new SchemaCreateTableEventArgs($table, $columns, $options, $this);
            $this->_eventManager->dispatchEvent(Events::onSchemaCreateTable, $eventArgs);

            if ($eventArgs->isDefaultPrevented()) {
                return array_merge($eventArgs->getSql(), $columnSql);
            }
        }

        $sql = $this->_getCreateTableSQL($tableName, $columns, $options);
        if ($this->supportsCommentOnStatement()) {
            foreach ($table->getColumns() as $column) {
                if ($this->getColumnComment($column)) {
                    $sql[] = $this->getCommentOnColumnSQL(
                        $tableName,
                        $column->getName(),
                        $this->getColumnComment($column)
                    );
                }
            }
        }

        return array_merge($sql, $columnSql);
    }
1285772
public function update(...$table) {
        $sql = new UpdateSQL($table);
        $sql->setDialect($this->dialect);

        return $sql;
    }
613590
protected function checkTable(string $table)
    {
        if (! property_exists($this, $table) || ! $this->$table instanceof Table) {
            throw new \InvalidArgumentException("Invalid table name: `{$table}`.");
        }
    }
460141
public function table($table) {
        $query = new Builder($this, $this->getQueryGrammar());

        return $query->from($table);
    }
493905
public function addTable(Table $table)
    {
        $this->tables->set($table->getTableName(), $table);
        
        return $this;
    }
1134428
public function table(string $table, string $alias = null, string $database = null)
    {
        $this->option->table->useRaw(false);
        $this->option->table->setTable($table);
        $this->option->table->setAlias($alias);
        $this->option->table->setDatabase($database);
        return $this;
    }
1238258
public static function table( $table, $connection = null )
	{
		return self::getInstance()->getConnection($connection)->table($table);
	}
524850
public function generateOneModel(Table $table)
    {
        $this->buildEntityRepository($table, $this->getNamespace());
        $this->buildEntity($table, $this->getNamespace());
        
        return $this;
    }
56010
public function from($table)
    {
        if ($this->tableReadOnly) {
            throw new Exception\InvalidArgumentException(
                'Since this object was created with a table and/or schema in the constructor, it is read only.'
            );
        }

        if (!is_string($table) &&
            !is_array($table) &&
            !$table instanceof TableIdentifier &&
            !$table instanceof Select
        ) {
            throw new Exception\InvalidArgumentException(
                '$table must be a string, array, an instance of TableIdentifier, or an instance of Select'
            );
        }

        if ($table instanceof TableIdentifier) {
            $table = $table->getTable(); // Ignore schema because it is not supported by SphinxQL
        }

        $this->table = $table;

        return $this;
    }
399045
final public function dropTable($table = null)
    {
        $table = $this->getTable($table);

        return $this->db->dropTable($table, true)
                        ->execute();
    }
748090
public function filter(Table $table)
    {
        $this->sqlAnds = [];
        $this->sqlParams = $this->initialParams;

        $columns = $table->getColumns();
        foreach ($table->getFilters() as $column => $filterData) {
            foreach ($filterData as $name => $value)
                $this->buildFilter($columns[$column]['sql_id'], $columns[$column]['type'], $name, $value);
        }

        return $this;
    }
1096562
public function setTable(\FrenchFrogs\Table\Table\Table $table)
    {
        $this->table = $table;
        return $this;
    }
326939
public function setTable($table)
    {
        if ($table === null) {
            $this->table = $table;
            return $this;
        }

        if (!is_string($table)) {
            throw new InvalidArgumentException(
                'Table reference must be a string.'
            );
        }

        if ($table === '') {
            throw new InvalidArgumentException(
                'Table reference can not be empty.'
            );
        }

        $this->table = $table;
        return $this;
    }
816059
protected function getTableDatabase($table)
    {
        if (!array_key_exists($table, $this->tables)) {
            return false;
        }

        $database = $this->tables[$table];

        # If this table's database depends on the mode
        if (is_array($database)) {
            if (array_key_exists($this->mode, $database)) {
                $database = $database[$this->mode];
            } else {
                $database = $database["default"];
            }
        }

        return $database;
    }
1088754
public function setTable($table){

		//put this in try...catch block for better error handling
		try{

			//check if from is empty
			if ( empty($table)) 
			{
				//throw new exception
				throw new MySQLException("Invalid argument passed for table name", 1);

			}

		}

		//diplay error message
		catch(MySQLException $MySQLExceptionObject){

			//display error message
			$MySQLExceptionObject->errorShow();

		}		

		//set the protected $from value
		$this->froms = $table;
		if(!isset($this->fields[$table])) $this->fields[$table] = array("*");
		return $this;
			
	}