library/Drakojn/Io/Driver/Descriptor/Json.php
public function serialize(Map $map, $object)
    {
        $properties = $map->getProperties();
        $data       = $this->prepareData($map, $object);
        $content    = [];
        foreach ($data as $localProperty => $value) {
            $value                                = serialize($value);
            $content[$properties[$localProperty]] = $value;
        }
        return json_encode((object)$content);
    }
public function serialize(Map $map, $object)
    {
        $properties = $map->getProperties();
        $data       = $this->prepareData($map, $object);
        $content    = [];
        foreach ($data as $localProperty => $value) {
            $value                                = serialize($value);
            $content[$properties[$localProperty]] = $value;
        }
        return json_encode((object)$content);
    }
Serializes Object

@param Map   $map    the object structure map
@param mixed $object candidate to serialize

@return mixed