File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
lib/OpenCloud/Common/Resource Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 28
28
29
29
abstract class PersistentResource extends BaseResource
30
30
{
31
+ const UPDATE_METHOD = 'PUT ' ;
32
+
31
33
/**
32
34
* Create a new resource
33
35
*
@@ -79,7 +81,16 @@ public function update($params = array())
79
81
$ this ->checkJsonError ();
80
82
81
83
// send the request
82
- return $ this ->getClient ()->put ($ this ->getUrl (), self ::getJsonHeader (), $ json )->send ();
84
+ return $ this ->makeUpdateRequest ($ json );
85
+ }
86
+
87
+ protected function makeUpdateRequest ($ json )
88
+ {
89
+ if ('PATCH ' === static ::UPDATE_METHOD ) {
90
+ return $ this ->getClient ()->patch ($ this ->getUrl (), self ::getJsonHeader (), $ json )->send ();
91
+ } else {
92
+ return $ this ->getClient ()->put ($ this ->getUrl (), self ::getJsonHeader (), $ json )->send ();
93
+ }
83
94
}
84
95
85
96
/**
You can’t perform that action at this time.
0 commit comments