private static function getHydratorClosure($object)
    {
        if (!isset(self::$hydratorClosure)) {
            self::$hydratorClosure = function($object, array $data) {
                foreach ($data as $name => $value) {
                    $object->$name = $value;
                }
            };
        }

        $class = get_class($object);

        if (!isset(self::$hydratorClosureCache[$class])) {
            self::$hydratorClosureCache[$class] = \Closure::bind(self::$hydratorClosure, null, $class);
        }

        return self::$hydratorClosureCache[$class];
    }