app/framework/core/Domain/DomainClientService.php 1 location
|
@@ 10-23 (lines=14) @@
|
| 7 |
|
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer; |
| 8 |
|
use Symfony\Component\Serializer\Serializer; |
| 9 |
|
|
| 10 |
|
class DomainClientService extends AbstractInjectionAware |
| 11 |
|
{ |
| 12 |
|
public function __construct($di) |
| 13 |
|
{ |
| 14 |
|
$this->setDI($di); |
| 15 |
|
} |
| 16 |
|
|
| 17 |
|
protected function toJsonObject($object) |
| 18 |
|
{ |
| 19 |
|
$serializer = new Serializer([new ObjectNormalizer()], [new JsonEncoder()]); |
| 20 |
|
|
| 21 |
|
return json_decode($serializer->serialize($object, 'json')); |
| 22 |
|
} |
| 23 |
|
} |
| 24 |
|
|
app/framework/core/Domain/PresenterEntity.php 1 location
|
@@ 13-21 (lines=9) @@
|
| 10 |
|
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer; |
| 11 |
|
use Symfony\Component\Serializer\Serializer; |
| 12 |
|
|
| 13 |
|
class PresenterEntity implements JsonSerializable |
| 14 |
|
{ |
| 15 |
|
public function jsonSerialize() |
| 16 |
|
{ |
| 17 |
|
$serializer = new Serializer([new ObjectNormalizer()], [new JsonEncoder()]); |
| 18 |
|
|
| 19 |
|
return json_decode($serializer->serialize($this, 'json')); |
| 20 |
|
} |
| 21 |
|
} |
| 22 |
|
|