diff --git a/Client.php b/Client.php index 7a4ce08..b7a1b28 100644 --- a/Client.php +++ b/Client.php @@ -184,7 +184,7 @@ public function getData( */ public function updateData( $entity_url, - $context = 'view', + $context = 'edit', array $data ) { // Set Set query data @@ -202,6 +202,35 @@ public function updateData( return $this; } + /** + * Update with entity url + * + * @param string $entity_url + * @param string $context view or edit + * @param array $data + * + * @return self + */ + public function patchData( + $entity_url, + $context = 'edit', + array $data + ) { + // Set Set query data + $data['context'] = $context; + + $this->request = + $this->createAuthenticatedRequest() + ->setMethod( 'patch' ) + ->setUrl( str_replace( $this->endpoint . '/', '', $entity_url ) )// Strip endpoint url from url param + ->setData( $data ) + ; + + $this->executeRequest(); + + return $this; + } + /** * Add data with entity url * @@ -242,7 +271,7 @@ public function addData( */ public function deleteData( $entity_url, - $context = 'view', + $context = 'edit', array $data ) { // Set context