src/Schema/State.php
public function syncState(State $source): self
    {
        $this->name = $source->name;
        $this->primaryKeys = $source->primaryKeys;

        $this->columns = [];
        foreach ($source->columns as $name => $column) {
            $this->columns[$name] = clone $column;
        }

        $this->indexes = [];
        foreach ($source->indexes as $name => $index) {
            $this->indexes[$name] = clone $index;
        }

        $this->foreignKeys = [];
        foreach ($source->foreignKeys as $name => $foreignKey) {
            $this->foreignKeys[$name] = clone $foreignKey;
        }

        $this->remountElements();

        return $this;
    }
public function syncState(State $source): self
    {
        $this->name = $source->name;
        $this->primaryKeys = $source->primaryKeys;

        $this->columns = [];
        foreach ($source->columns as $name => $column) {
            $this->columns[$name] = clone $column;
        }

        $this->indexes = [];
        foreach ($source->indexes as $name => $index) {
            $this->indexes[$name] = clone $index;
        }

        $this->foreignKeys = [];
        foreach ($source->foreignKeys as $name => $foreignKey) {
            $this->foreignKeys[$name] = clone $foreignKey;
        }

        $this->remountElements();

        return $this;
    }
public function syncState ( State $ source ) : self { $ this -> name = $ source -> name ; $ this -> primaryKeys = $ source -> primaryKeys ; $ this -> columns = [ ] ; foreach ( $ source -> columns as $ name => $ column ) { $ this -> columns [ $ name ] = clone $ column ; } $ this -> indexes = [ ] ; foreach ( $ source -> indexes as $ name => $ index ) { $ this -> indexes [ $ name ] = clone $ index ; } $ this -> foreignKeys = [ ] ; foreach ( $ source -> foreignKeys as $ name => $ foreignKey ) { $ this -> foreignKeys [ $ name ] = clone $ foreignKey ; } $ this -> remountElements ( ) ; return $ this ; }
Re-populate schema elements using other state as source. Elements will be cloned under their
schema name.

@param State $source

@return self
Re - populate schema elements using other state as source . Elements will be cloned under their schema name .