src/Graviton/AnalyticsBundle/Helper/JsonMapper.php
public function map($json, $object)
    {
        foreach ($json as $key => $jvalue) {
            $key = $this->getSafeName($key);
            $setter = 'set' . $this->getCamelCaseName($key);
            if (method_exists($object, $setter)) {
                $object->{$setter}($jvalue);
            }
        }

        return $object;

    }
public function map($json, $object)
    {
        foreach ($json as $key => $jvalue) {
            $key = $this->getSafeName($key);
            $setter = 'set' . $this->getCamelCaseName($key);
            if (method_exists($object, $setter)) {
                $object->{$setter}($jvalue);
            }
        }

        return $object;

    }
public function map ( $ json , $ object ) { foreach ( $ json as $ key => $ jvalue ) { $ key = $ this -> getSafeName ( $ key ) ; $ setter = 'set' . $ this -> getCamelCaseName ( $ key ) ; if ( method_exists ( $ object , $ setter ) ) { $ object -> { $ setter } ( $ jvalue ) ; } } return $ object ; }
Maps data into object class

@param object $json   to be casted
@param object $object Class to receive data
@throws InvalidArgumentException
@return object
Maps data into object class