name = $name; $this->email = $email; $this->setIdentity($identity); } /** * @param string $name * @param \XaiCorp\AbcParser\Domain\Atoms\EmailAtom $email * @param \Webpatser\Uuid\Uuid|null $identity * @return static * @throws \Enzyme\Axiom\Exceptions\AtomException */ public static function create(string $name, EmailAtom $email, Uuid $identity = null) { $nameAtom = new StringAtom($name); return new static($nameAtom, $email, $identity); } /** * Checks whether this model has the given attribute set. * * @param string $attribute * * @return boolean */ public function has($attribute) { return in_array($attribute, [ 'name', 'email', ]); } /** * Get the value associated with the given attribute. * * @param string $attribute * * @return mixed */ public function get($attribute) { if (!$this->has($attribute)) { throw new Exception('Cannot access attribute on person'); } return $this->{$attribute}; } /** * Get all the attributes associated with this model. * * @return array */ public function getAll() { // TODO: Implement getAll() method. } }