Create a map body.

@param Blueprint $blueprint
@param Fluent    $command

@return array
546908
public function compileCreate(Blueprint $blueprint, Fluent $command)
    {
        $fields = $blueprint->getFields();

        $statement = $this->compileFields($fields);

        return $statement;
    }
1052821
protected function getAttributes(Blueprint\BlueprintInterface $blueprint)
    {
        return [
            'type' => $blueprint::getType(),
            'from_user_id' => ($fromUser = $blueprint->getFromUser()) ? $fromUser->id : null,
            'subject_id' => ($subject = $blueprint->getSubject()) ? $subject->id : null,
            'data' => ($data = $blueprint->getData()) ? json_encode($data) : null
        ];
    }
220330
public function fillFromBlueprint(Blueprint $blueprint, $set) {
        $this->addItemsFromBlueprint($blueprint);
        $this->setOrder($blueprint->getToolbarOrder($set));
    }
82558
public function compileCreate(Blueprint $blueprint, Fluent $command, Connection $connection)
    {
        $sql = parent::compileCreate($blueprint, $command, $connection);
        // 添加注释
        if (isset($blueprint->comment))
        {
            $blueprint->comment = str_replace("'", "\'", $blueprint->comment);
            $sql .= " comment = '".$blueprint->comment."'";
        }
        // 添加自增起始值
        if (isset($blueprint->autoIncrement)) {
            $blueprint->autoIncrement = intval($blueprint->autoIncrement);
            $sql .= " auto_increment = {$blueprint->autoIncrement}";
        }
        return $sql;
    }
1294054
protected function createBlueprint()
	{
		$tmpl = file_get_contents( __DIR__ . "/Blueprint.tmpl" );
		$tmpl = str_replace( [ '{{NAME}}', '{{NAMESPACE}}' ], [ $this->name, $this->namespace ], $tmpl );
		$path = app_path( "Contracts/Blueprints/{$this->name}.php" );
		if( ! file_exists( $path ) ) {
			file_put_contents( $path, $tmpl );
		}
	}
122335
public function compileRenameIndex(Blueprint $blueprint, Fluent $command, Connection $connection)
    {
        $schemaManager = $connection->getDoctrineSchemaManager();

        $indexes = $schemaManager->listTableIndexes($this->getTablePrefix().$blueprint->getTable());

        $index = Arr::get($indexes, $command->from);

        if (! $index) {
            throw new RuntimeException("Index [{$command->from}] does not exist.");
        }

        $newIndex = new Index(
            $command->to, $index->getColumns(), $index->isUnique(),
            $index->isPrimary(), $index->getFlags(), $index->getOptions()
        );

        $platform = $schemaManager->getDatabasePlatform();

        return [
            $platform->getDropIndexSQL($command->from, $this->getTablePrefix().$blueprint->getTable()),
            $platform->getCreateIndexSQL($newIndex, $this->getTablePrefix().$blueprint->getTable()),
        ];
    }
256399
private function prepareBindingClosure($id, $blueprint, $dependencies = null): Closure
    {
        if ($this->bindings[$id]['singleton']) {
            return $this->prepareSingletonBindingClosure($id, $blueprint, $dependencies);
        }

        return $this->preparePrototypeBindingClosure($id, $blueprint, $dependencies);
    }
950365
private function validateEvent(Blueprint $blueprint)
    {
        if (! in_array(strtolower($blueprint->event), $this->events)) {
            throw new InvalidArgumentException("Cannot use {$blueprint->event} as trigger event.");
        }

        return $blueprint->event;
    }
512545
public function compilePrimary(Blueprint $blueprint, Fluent $command)
    {
        $create = $this->getCommandByName($blueprint, 'create');

        if (is_null($create)) {
            $columns = $this->columnize($command->columns);

            $table = $this->wrapTable($blueprint);

            return "alter table {$table} add constraint {$command->index} primary key ({$columns})";
        }
    }
61682
public function compileCreate(Blueprint $blueprint, Fluent $command)
    {
        return sprintf('%s table %s (%s)',
            $blueprint->temporary ? 'create temporary' : 'create',
            $this->wrapTable($blueprint),
            implode(', ', $this->getColumns($blueprint))
        );
    }
1174141
protected function compileCreateTable($blueprint, $command, $connection)
    {
        return sprintf('%s table %s (%s)',
            $blueprint->temporary ? 'create temporary' : 'create',
            $this->wrapTable($blueprint),
            implode(', ', $this->getColumns($blueprint))
        );
    }
1080082
public function compileCreate(Blueprint $blueprint, Fluent $command, Connection $connection) {
       
        // $columns = implode(', ', $this->getColumns($blueprint));
        //$sql = 'create class '.$this->wrapTable($blueprint)." ($columns)";
        return  $sql = 'create class '.$this->wrapTable($blueprint)." extends V";
    }
184850
public function create($blueprint)
    {
        $name = $blueprint->name;
        $type = $blueprint->type;
        if (!isset($this->count[$name])) {
            $this->count[$name] = 0;
        }

        $count = ++$this->count[$name];

        $values = $blueprint->values();

        $strings = array_map(function ($value) use ($count) {
            return str_replace('#{sn}', str_pad($count, 4, '0', STR_PAD_LEFT), $value);
        }, $blueprint->strings());

        $relationships = $blueprint->relationships();

        foreach ($relationships as $key => $relationship) {
            $relationships[$key] = $relationship->create($blueprint->persisted);
        }

        $values = array_merge($values, $strings, $relationships);

        $dependencies = array_map(function ($value) use ($values) {
            return $value->meet($values);
        }, $blueprint->dependencies());

        $values = array_merge($values, $dependencies);

        //$object = $this->toObject($name, $values);
        $object = $this->to_object($name, $values); // @deprecated Backwards compatibility

        if (false == $blueprint->persisted) {
            return $object;
        }

        \Phactory::triggers()->beforeSave($name, $type, $object);

        //$object = $this->saveObject($name, $object);
        $object = $this->save_object($name, $object); // @deprecated Backwards compatibility

        \Phactory::triggers()->afterSave($name, $type, $object);

        return $object;
    }
18781
public function compileRenameColumn(Blueprint $blueprint, Fluent $command, Connection $connection)
    {
        $table = $this->wrapTable($blueprint);

        $rs    = [];
        $rs[0] = 'alter table ' . $table . ' rename column ' . $command->from . ' to ' . $command->to;

        return (array) $rs;
    }
118999
protected function modifyCollate(Blueprint $blueprint, Fluent $column)
    {
        if (! is_null($column->collation)) {
            return ' collate '.$column->collation;
        }
    }
1244170
public function compileDropColumn(Blueprint $blueprint, Fluent $command) {
        $table  = $this->wrapTable($blueprint);
        // @TODO: always one column; or more?
        $column = $command->columns[0];

        // @TODO: changed syntax; is there a better writing
        return 'DROP PROPERTY ' . $table . '.' . $column . ' IF EXISTS';
    }
941519
protected function applyBlueprint(Blueprint $blueprint)
    {
        foreach ($blueprint->columns as $column) {
            $this->updateColumn($blueprint->table, $blueprint->primary, $column);
        }
    }