Created
June 8, 2016 20:45
-
-
Save Mulkave/8a57bf6998fb7c0b050bbda54b8f1f2e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Directory\Data\Entities\Citizen; | |
use Directory\Foundation\Entity; | |
use Directory\Data\Entities\Citizen\Values\SSN; | |
use Directory\Data\Entities\Citizen\Values\Name; | |
use Directory\Data\Entities\Citizen\Values\Email; | |
use Directory\Data\Entities\Citizen\Values\Address; | |
use Directory\Data\Entities\Citizen\Values\Occupation; | |
class Citizen extends Entity | |
{ | |
protected $fillable = [ | |
'name', | |
'email', | |
'address', | |
'ssn', | |
'occupation', | |
]; | |
public function register( | |
Name $name, | |
Email $email, | |
SSN $ssn, | |
Occupation $occupation, | |
Address $address | |
) { | |
return static::create( | |
[ | |
'ssn' => (int) $ssn->getValue(), | |
'name' => (string) $name, | |
'email' => (string) $email, | |
'address' => (string) $address, | |
'occupation' => (string) $occupation, | |
] | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment