Modify a table on the schema.

@param  string    $table
@param  \Closure  $callback
@return \Illuminate\Database\Schema\Blueprint
971315
public function table($table, Closure $callback) {
        $blueprint = $this->createBlueprint($table, $callback);
        $this->build($blueprint);
        $class = $this->connection->getClient()->makeClass($blueprint->getTable());
        $class->setProperty($blueprint->getColumns());
        $class->saveProperties();
    }
1226959
public static function table($table, $value, $key = 'id', \Closure $whereCallback = null, $connection = null)
    {
        $query = DB::connection($connection)
                   ->table($table)
                   ->select("{$value} as label", "{$key} as value");

        if ($whereCallback) {
            $query->where($whereCallback);
        }

        return $query->get();
    }
277772
public function update($table) {
        $obj = new UpdateRule(new Context($this->connection));
        return $obj->update($table);
    }
1094266
public function map(\Closure $callback)
    {

        $this->_items = array_map($callback, $this->_items);

        return $this;
    }
1200517
public static function make($table, Closure $closure)
    {
        if (is_array($table)) {
            $table = isset($table['table']) ? $table['table'] : $table;
            $database = isset($table['database']) ? $table['database'] : null;
            $schema = new static($table, $database);
        } else {
            $schema = new static($table);
        }

        $callback = $closure($schema);
        /*
        | Set database connection name
        */
        $schema->on($schema->getDatabase());
        $schema->run();

        return $callback;
    }
716486
public function create($table, Closure $callback = null)
    {
        $blueprint = $this->createBlueprint($table);
        $blueprint->create();
        if ($callback) {
            $callback($blueprint);
        }
    }
66878
public function table($name, callable $callback)
    {
        $blueprint = new Blueprint($name, $callback);

        $this->blueprints[$name] = $blueprint->build();
    }
1264318
public function update($table = null)
    {
        $this->type = self::TYPE_UPDATE;
        if ($table) {
            $this->table($table);
        }

        return $this;
    }
901260
public function transaction( Closure $callback ) {
		$show_error = $this->wpdb->show_errors;

		// Prevent the wpdb errors.
		$this->wpdb->hide_errors();

		$this->beginTransaction();

		try {
			// We'll simply execute the given callback within a try / catch block
			// and if we catch any exception we can rollback the transaction
			// so that none of the changes are persisted to the database.
			$result = $callback( $this );

			$this->commit();
		} catch ( \Exception $e ) {
			// If we catch an exception, we will roll back so nothing gets messed
			// up in the database. Then we'll re-throw the exception so it can
			// be handled how the developer sees fit for their applications.
			$this->rollBack();

			throw $e;
		}

		$this->wpdb->show_errors( $show_error );

		return $result;
	}
311859
public function update($table, Closure $closure)
    {
        $blueprint = $this->createBlueprint($table, $closure);
        $blueprint->update();
    }
666386
public function setEditableColumns($callback = NULL)
    {
        $this->onRender[] = function(Grid $grid) use ($callback) {
            if (!$grid->hasColumns()) {
                return;
            }

            foreach ($grid->getComponent(Column::ID)->getComponents() as $column) {
                if ($column instanceof Editable && !$column->isEditableDisabled() && !$column->editableCallback) {
                    $column->setEditable($callback);
                }
            }
        };

        return $this;
    }
262029
protected function createBlueprint($table, Closure $callback = null)
    {
        $blueprint = new OracleBlueprint($table, $callback);
        $blueprint->setTablePrefix($this->connection->getTablePrefix());

        return $blueprint;
    }
757952
public function joinClosure(string $table, \Closure $callback): BaseQueryRelateContract
    {
        $this->query->join($table, $callback);

        return $this;
    }
811504
final public function alter($table, callable $cb)
    {
        $table = $this->getTablePrefixed($table);

        call_user_func_array($cb, [
            $generator = new SQLGenerator($table, $this->adapter->getName(), 'alter')
        ]);

        $sql = sprintf('ALTER TABLE `%s` %s;', $table, $generator->make());

        return $this->executeSqlQuery($sql);
    }
1262847
protected function createBlueprint($label, Closure $callback = null)
    {
        if (isset($this->resolver))
        {
            return call_user_func($this->resolver, $label, $callback);
        }
        else
        {
            return new Blueprint($label, $callback);
        }
    }
895734
protected function _update(&$Schema, $table = null) {
		$db = ConnectionManager::getDataSource($this->Schema->connection);

		$this->out(__d('cake_console', 'Comparing Database to Schema...'));
		$options = array();
		$this->params['force'] = false;
		if (isset($this->params['force'])) {
			$options['models'] = false;
		}
		$Old = $this->Schema->read($options);
		$compare = $this->Schema->compare($Old, $Schema);

		$contents = array();
		if (!empty($compare['media'])) {
			unset($compare['media']);
		}
		if (empty($table)) {
			foreach ($compare as $table => $changes) {
				if (isset($compare[$table]['create'])) {
					$contents[$table] = $db->createSchema($Schema, $table);
				} else {
					$contents[$table] = $db->alterSchema(array($table => $compare[$table]), $table);
				}
			}
		} elseif (isset($compare[$table])) {
			if (isset($compare[$table]['create'])) {
				$contents[$table] = $db->createSchema($Schema, $table);
			} else {
				$contents[$table] = $db->alterSchema(array($table => $compare[$table]), $table);
			}
		}

		if (empty($contents)) {
			$this->out(__d('cake_console', 'Schema is up to date.'));
			return false;
		}

		$this->out("\n" . __d('cake_console', 'The following statements will run.'));
		$this->out(array_map('trim', $contents));
		if (!empty($this->params['yes']) ||
			$this->in(__d('cake_console', 'Are you sure you want to alter the tables?'), array('y', 'n'), 'n') === 'y'
		) {
			$this->out();
			$this->out(__d('cake_console', 'Updating Database...'));
			$this->_run($contents, 'update', $Schema);
		}

		$this->out(__d('cake_console', 'End update.'));
	}
37786
public function extend($driver, \Closure $callback)
    {
        $this->customCreators[$driver] = $callback->bindTo($this, $this);

        return $this;
    }