generated from Nodarx/template
refactor: use new mail interface desing
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -9,7 +9,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace KTXM\ProviderImap\Providers;
|
||||
|
||||
use DateTimeInterface;
|
||||
use KTXM\ProviderImap\Client\Message;
|
||||
use KTXF\Mail\Entity\EntityMutableAbstract;
|
||||
|
||||
@@ -43,27 +42,6 @@ class EntityResource extends EntityMutableAbstract {
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert mail entity object to store array
|
||||
*/
|
||||
public function toStore(): array {
|
||||
return array_merge(
|
||||
$this->data,
|
||||
['properties' => $this->getProperties()->toStore()]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Hydrate mail entity object from store array
|
||||
*/
|
||||
public function fromStore(array $data): static {
|
||||
$properties = $data['properties'] ?? [];
|
||||
unset($data['properties']);
|
||||
$this->data = $data;
|
||||
$this->getProperties()->fromStore($properties);
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user