LazyRecord\SqlBuilder\BaseBuilder::build PHP Method

build() public method

public build ( LazyRecord\Schema\SchemaInterface $schema )
$schema LazyRecord\Schema\SchemaInterface
    public function build(SchemaInterface $schema)
    {
        if ($schema instanceof BaseModel) {
            $model = $schema;
            $schema = new DynamicSchemaDeclare($model);
        }
        $sqls = [];
        $tableSqls = $this->buildTable($schema);
        $sqls = array_merge($sqls, $tableSqls);
        $indexSqls = $this->buildIndex($schema);
        $sqls = array_merge($sqls, $indexSqls);
        return $sqls;
    }