mirror of
https://github.com/Karaka-Management/oms-Profile.git
synced 2026-02-16 15:28:41 +00:00
start testing pure model datamapper implementation
This commit is contained in:
parent
94bf7caf3b
commit
986840730c
|
|
@ -42,10 +42,10 @@ class Profile implements \JsonSerializable
|
||||||
/**
|
/**
|
||||||
* Profile image.
|
* Profile image.
|
||||||
*
|
*
|
||||||
* @var int|Media
|
* @var Media
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected $image;
|
protected Media $image;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Birthday.
|
* Birthday.
|
||||||
|
|
@ -58,10 +58,10 @@ class Profile implements \JsonSerializable
|
||||||
/**
|
/**
|
||||||
* Account.
|
* Account.
|
||||||
*
|
*
|
||||||
* @var int|Account
|
* @var Account
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected $account;
|
protected Account $account;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Location data.
|
* Location data.
|
||||||
|
|
@ -166,7 +166,7 @@ class Profile implements \JsonSerializable
|
||||||
*/
|
*/
|
||||||
public function getImage() : Media
|
public function getImage() : Media
|
||||||
{
|
{
|
||||||
return $this->image;
|
return $this->image ?? new NullMedia();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -241,7 +241,11 @@ class Profile implements \JsonSerializable
|
||||||
public function jsonSerialize()
|
public function jsonSerialize()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
|
'account' => $this->account,
|
||||||
|
'image' => $this->image,
|
||||||
|
'location' => $this->location,
|
||||||
|
'contactelement' => $this->contactElements,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user