Skip to content

Commit

Permalink
Add sleep and wakeup magin methods to support serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Edujugon committed Apr 10, 2018
1 parent 2b87672 commit b08351a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/XMLMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -497,4 +497,16 @@ protected function customCondition($element, $val)
return $found;
}

public function __sleep()
{
//obj property is excluded to prevent serialization issues
return ['xml'];
}

public function __wakeup()
{
// Generate object
$this->loadXML($this->getXml());
}

}

0 comments on commit b08351a

Please sign in to comment.