public function jsonSerialize(): stdClass
    {
        $object = (object)object_get_properties($this, $this instanceof DynamicEntity);

        /** @var Event\ToJson $event */
        $event = $this->dispatchEvent(new Event\ToJson($this, $object));
        $data = i\type_check($event->getPayload(), stdClass::class, new UnexpectedValueException());

        return $data;
    }
public function jsonSerialize(): stdClass
    {
        $object = (object)object_get_properties($this, $this instanceof DynamicEntity);

        /** @var Event\ToJson $event */
        $event = $this->dispatchEvent(new Event\ToJson($this, $object));
        $data = i\type_check($event->getPayload(), stdClass::class, new UnexpectedValueException());

        return $data;
    }
public function jsonSerialize ( ) : stdClass { $ object = ( object ) object_get_properties ( $ this , $ this instanceof DynamicEntity ) ; /** @var Event\ToJson $event */ $ event = $ this -> dispatchEvent ( new Event \ ToJson ( $ this , $ object ) ) ; $ data = i \ type_check ( $ event -> getPayload ( ) , stdClass :: class , new UnexpectedValueException ( ) ) ; return $ data ; }
Prepare entity for JsonSerialize encoding

@return stdClass
Prepare entity for JsonSerialize encoding