source/Spiral/ORM/Schemas/RecordSchema.php
protected function packDefaults(AbstractTable $table): array
    {
        //We need mutators to normalize default values
        $mutators = $this->buildMutators($table);

        $defaults = [];
        foreach ($table->getColumns() as $column) {
            $field = $column->getName();

            $default = $column->getDefaultValue();

            //For non null values let's apply mutators to typecast it
            if (!is_null($default) && !is_object($default) && !$column->isNullable()) {
                $default = $this->mutateValue($mutators, $field, $default);
            }

            $defaults[$field] = $default;
        }

        return $defaults;
    }
protected function packDefaults(AbstractTable $table): array
    {
        //We need mutators to normalize default values
        $mutators = $this->buildMutators($table);

        $defaults = [];
        foreach ($table->getColumns() as $column) {
            $field = $column->getName();

            $default = $column->getDefaultValue();

            //For non null values let's apply mutators to typecast it
            if (!is_null($default) && !is_object($default) && !$column->isNullable()) {
                $default = $this->mutateValue($mutators, $field, $default);
            }

            $defaults[$field] = $default;
        }

        return $defaults;
    }
protected function packDefaults ( AbstractTable $ table ) : array { //We need mutators to normalize default values $ mutators = $ this -> buildMutators ( $ table ) ; $ defaults = [ ] ; foreach ( $ table -> getColumns ( ) as $ column ) { $ field = $ column -> getName ( ) ; $ default = $ column -> getDefaultValue ( ) ; //For non null values let's apply mutators to typecast it if ( ! is_null ( $ default ) && ! is_object ( $ default ) && ! $ column -> isNullable ( ) ) { $ default = $ this -> mutateValue ( $ mutators , $ field , $ default ) ; } $ defaults [ $ field ] = $ default ; } return $ defaults ; }
Generate set of default values to be used by record.

@param AbstractTable $table

@return array
Generate set of default values to be used by record .