public function getSchema($asPlainArray = true)
    {
        return !$asPlainArray ? $this->tables : array_map(function ($table) {
            return [
                'name' => $table->getName(),
                'pkey' => $table->getPrimaryKey(),
                'comment' => $table->getComment(),
                'columns' => array_map(function ($column) {
                    return [
                        'name' => $column->getName(),
                        'type' => $column->getType(),
                        'length' => $column->getLength(),
                        'comment' => $column->getComment(),
                        'values' => $column->getValues(),
                        'default' => $column->getDefault(),
                        'nullable' => $column->isNullable()
                    ];
                }, $table->getFullColumns()),
                'relations' => array_map(function ($rel) {
                    $relation = clone $rel;
                    $relation->table = $relation->table->getName();
                    if ($relation->pivot) {
                        $relation->pivot = $relation->pivot->getName();
                    }
                    return (array)$relation;
                }, $table->getRelations())
            ];
        }, $this->tables);
    }
public function getSchema($asPlainArray = true)
    {
        return !$asPlainArray ? $this->tables : array_map(function ($table) {
            return [
                'name' => $table->getName(),
                'pkey' => $table->getPrimaryKey(),
                'comment' => $table->getComment(),
                'columns' => array_map(function ($column) {
                    return [
                        'name' => $column->getName(),
                        'type' => $column->getType(),
                        'length' => $column->getLength(),
                        'comment' => $column->getComment(),
                        'values' => $column->getValues(),
                        'default' => $column->getDefault(),
                        'nullable' => $column->isNullable()
                    ];
                }, $table->getFullColumns()),
                'relations' => array_map(function ($rel) {
                    $relation = clone $rel;
                    $relation->table = $relation->table->getName();
                    if ($relation->pivot) {
                        $relation->pivot = $relation->pivot->getName();
                    }
                    return (array)$relation;
                }, $table->getRelations())
            ];
        }, $this->tables);
    }
public function getSchema ( $ asPlainArray = true ) { return ! $ asPlainArray ? $ this -> tables : array_map ( function ( $ table ) { return [ 'name' => $ table -> getName ( ) , 'pkey' => $ table -> getPrimaryKey ( ) , 'comment' => $ table -> getComment ( ) , 'columns' => array_map ( function ( $ column ) { return [ 'name' => $ column -> getName ( ) , 'type' => $ column -> getType ( ) , 'length' => $ column -> getLength ( ) , 'comment' => $ column -> getComment ( ) , 'values' => $ column -> getValues ( ) , 'default' => $ column -> getDefault ( ) , 'nullable' => $ column -> isNullable ( ) ] ; } , $ table -> getFullColumns ( ) ) , 'relations' => array_map ( function ( $ rel ) { $ relation = clone $ rel ; $ relation -> table = $ relation -> table -> getName ( ) ; if ( $ relation -> pivot ) { $ relation -> pivot = $ relation -> pivot -> getName ( ) ; } return ( array ) $ relation ; } , $ table -> getRelations ( ) ) ] ; } , $ this -> tables ) ; }
Get the full schema as an array that you can serialize and store
@return array
Get the full schema as an array that you can serialize and store