LazyRecord\Schema\DeclareSchema::build PHP Méthode

build() protected méthode

The post process find the primary key from the built columns And insert the auto-increment primary is auto_id config is enabled.
protected build ( array $options = [] )
$options array
    protected function build(array $options = array())
    {
        $this->schema($options);
        // postSchema is added for mixin that needs all schema information, for example LocalizeMixin
        foreach ($this->mixinSchemas as $mixin) {
            $mixin->postSchema();
        }
        $this->primaryKey = $this->findPrimaryKey();
        // if the primary key is not define, we should append the default primary key => id
        // AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY
        if (false === $this->primaryKey) {
            if ($config = ConfigLoader::getInstance()) {
                if ($config->hasAutoId() && !isset($this->columns['id'])) {
                    $this->insertAutoIdPrimaryColumn();
                }
            }
        }
    }