private function setObjectProperty($entity, $name, $value)
    {
        $setter = 'set'.ucfirst($name);

        if (!method_exists($entity, $setter)) {
            throw RestException::missingSetter($entity, $name, $setter);
        }

        return $entity->$setter($value);
    }