新建表
@param string $table
@param callable $callback
@return mixed
161961
public static function createTable($table, callable $callback) {
        $table = new Table($table);
        call_user_func($callback, $table);
        return $table->create();
    }
1266350
public function update($table = null)
    {
        if (!$table) {
            /** @var \Cake\ORM\Table $repository */
            $repository = $this->getRepository();
            $table = $repository->getTable();
        }

        return parent::update($table);
    }
620458
public function table($table, Closure $callback)
    {
        $blueprint = $this->createBlueprint($table);
        if ($callback) {
            $callback($blueprint);
        }
    }
737729
function create($callback = false)
    {

        $index = new Index($this->index, $callback);

        $index->connection = $this->connection;

        return $index->create();
    }
148530
public function getJoinColumn(callable $callback = null)
    {
        $joinColumn = reset($this->joinColumns);

        if (is_callable($callback)) {
            $callback($joinColumn);
        }

        return $joinColumn;
    }
1059542
public function table($table, Closure $callback)
    {
    	if(!$this->hasTable($table)) {
    		return hst_message('is has table');
    	}
        \Schema::connection($this->databaseName)->table($table, $callback);
    }
691685
public function call(callable $callback, $connection = null)
    {
        $this->database->connection($connection)->beginTransaction();

        try
        {
            $result = $callback($this->database);

            $this->database->connection($connection)->commit();
            $this->state = static::STATE_COMMIT;

            return $result;
        }
        catch (\Exception $exception)
        {
            $this->database->connection($connection)->rollBack();
            $this->state = static::STATE_ROLLBACK;

            return null;
        }
    }
6853
public function saveTable($name, callable $callback, $ifNotExists = true, $options = [])
    {
        $options = $this->prepareBCOptions($options);

        return $this->getTable($name)->save($callback, $ifNotExists, $options);
    }
215649
protected function bindOriginalRow(Closure $callback, $key)
    {
        $originalRow = static::$originalGridData[$key];

        return $callback->bindTo(static::$model->newFromBuilder($originalRow));
    }
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;
	}
1264318
public function update($table = null)
    {
        $this->type = self::TYPE_UPDATE;
        if ($table) {
            $this->table($table);
        }

        return $this;
    }
1231509
public function addCallback($callback, $driver = null)
	{
		if (!empty($driver)) {
			if (is_array($driver)) {
				if (!in_array($this->index->driver, $driver)) {
					return $this;
				}
			}
			else if ($driver != $this->index->driver) {
				return $this;
			}
		}
		
		$this->callbacks[] = $callback;
		
		return $this;
	}
1323373
protected function createBlueprint($table, Closure $callback = null)
    {
        $prefix = $this->connection->getConfig('prefix_indexes')
                    ? $this->connection->getConfig('prefix')
                    : '';

        if (isset($this->resolver)) {
            return call_user_func($this->resolver, $table, $callback, $prefix);
        }

        return new Blueprint($table, $callback, $prefix);
    }
1017781
protected function onUpdate(callable $callback, $entityClass = null)
    {
        $this->checkIfInitialized();

        return $this->processEntities($this->uow->getScheduledEntityUpdates(), self::OPERATION_UPDATE, $callback, $entityClass);
    }
1285772
public function update(...$table) {
        $sql = new UpdateSQL($table);
        $sql->setDialect($this->dialect);

        return $sql;
    }
428180
public function leftJoinClosure(string $table, \Closure $callback): BaseQueryRelateContract
    {
        $this->query->leftjoin($table, $callback);

        return $this;
    }
1290622
public function each(callable $callback)
    {
        $array = $this->getArrayCopy();
        foreach ($array as $key => $value) {
            $callback($value, $key, $array);
        }
    }