use MongoDB\BSON\Serializable;
use MongoDB\Model\BSONDocument;
use Edd\MongoDbHelpers\MongoModelInterface
class User implements Serializable, MongoModelInterface
{
public $userGuid;
public $email;
public $firstName;
public $lastName;
public function bsonSerialize() : array
{
return [
'UserUuid' => $this->userUuid,
'Email' => $this->email,
'FirstName' => $this->firstName,
'LastName' => $this->lastName
];
}
public function map(BSONDocument $document)
{
$this->userUuid = $document['UserUuid'];
$this->email = $document['Email'];
$this->firstName = $document['FirstName'];
$this->lastName = $document['LastName'];
}
public function toArray() : array
{
return get_object_vars($this);
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.