Last active
December 4, 2019 10:35
-
-
Save semihkeskindev/768b63b16d96766bf099128b2c8fa42b to your computer and use it in GitHub Desktop.
serialization class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use klass\a\UserRegistrationJob; | |
$app = new UserRegistrationJob('semih', 'keskin'); | |
$serialize = serialize($app); | |
return unserialize($serialize); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require __DIR__.'/UserRegistrationJob.php'; | |
$app = require __DIR__.'/execute.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace klass\a; | |
class UserRegistrationJob implements \JsonSerializable | |
{ | |
private $name; | |
private $surname; | |
public function __construct($name,$surname) | |
{ | |
$this->name = $name; | |
$this->surname = $surname; | |
} | |
public function handle() | |
{ | |
} | |
public function __wakeup() | |
{ | |
$this->handle(); | |
} | |
public function jsonSerialize() | |
{ | |
return $this; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment