email; } public function setEmail(string $email): User { $this->email = $email; return $this; } public function getPassword(): string { return $this->password; } public function setPassword(string $password): User { $this->password = $password; return $this; } public function getName(): string { return $this->name; } public function setName(string $name): User { $this->name = $name; return $this; } /** * @param string[] $props Properties of the User model * @return User */ public static function fromArray(array $props): User { $user = new self($props['email'], $props['password'], $props['name']); if (array_key_exists('id', $props)) { $user->setId($props['id']); } if (array_key_exists('createdAt', $props)) { $user->setCreatedAt($props['createdAt']); } if (array_key_exists('updatedAt', $props)) { $user->setUpdatedAt($props['updatedAt']); } return $user; } }