private function ReassignContents(Layout $prevLayout, Layout $newLayout)
    {
        if ($prevLayout->Equals($newLayout)) {
            return;
        }
        $oldAreas = Area::Schema()->FetchByLayout(false, $prevLayout);
        
        foreach ($oldAreas as $oldArea)
        {
            $newArea = $this->FindNewArea($oldArea, $newLayout);
            if ($newArea) {
                $this->TransferArea($oldArea, $newArea);
            }
            else{
                $this->ClearArea($oldArea);
            }
        }
     }
private function ReassignContents(Layout $prevLayout, Layout $newLayout)
    {
        if ($prevLayout->Equals($newLayout)) {
            return;
        }
        $oldAreas = Area::Schema()->FetchByLayout(false, $prevLayout);
        
        foreach ($oldAreas as $oldArea)
        {
            $newArea = $this->FindNewArea($oldArea, $newLayout);
            if ($newArea) {
                $this->TransferArea($oldArea, $newArea);
            }
            else{
                $this->ClearArea($oldArea);
            }
        }
     }
private function ReassignContents ( Layout $ prevLayout , Layout $ newLayout ) { if ( $ prevLayout -> Equals ( $ newLayout ) ) { return ; } $ oldAreas = Area :: Schema ( ) -> FetchByLayout ( false , $ prevLayout ) ; foreach ( $ oldAreas as $ oldArea ) { $ newArea = $ this -> FindNewArea ( $ oldArea , $ newLayout ) ; if ( $ newArea ) { $ this -> TransferArea ( $ oldArea , $ newArea ) ; } else { $ this -> ClearArea ( $ oldArea ) ; } } }
Reassigns contents by area names if layout was changed
@param Layout $prevLayout The old layout
@param Layout $newLayout The new layout
Reassigns contents by area names if layout was changed