Skip to content

Commit

Permalink
Merge pull request #2 from heniroger/6.0.0-dev
Browse files Browse the repository at this point in the history
add serialize magic method
  • Loading branch information
heniroger authored Aug 18, 2022
2 parents 081aca1 + 373f0dd commit ced352b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,28 @@ public function unserialize($serialized)
{
list($id, $secret) = explode('|', $serialized);

$this->__construct($id, $secret);
}

/**
* Serializes the Application entity as a string.
*
* @return string
*/
public function __serialize()
{
return implode('|', [$this->id, $this->secret]);
}

/**
* Unserializes a string as an Application entity.
*
* @param string $serialized
*/
public function __unserialize($serialized)
{
list($id, $secret) = explode('|', $serialized);

$this->__construct($id, $secret);
}
}

0 comments on commit ced352b

Please sign in to comment.