diff --git a/readme.md b/readme.md index e37de15..2d341f2 100644 --- a/readme.md +++ b/readme.md @@ -168,6 +168,9 @@ As with the write method you can also run multiple update operations together by When using updateMultiple every item MUST have an ID. +> :heavy_exclamation_mark: This method returns the row that has been updated. It does not always return the updated data, as SharePoint can take longer to update than this method takes to run. +> It is therefore not recommended to use this as a check to ensure a successful update. + #### Deleting Rows In order to delete a row, an ID as well as list name is required. To remove the record for James with the ID 5 you would use: diff --git a/src/Thybag/Auth/SharePointOnlineAuth.php b/src/Thybag/Auth/SharePointOnlineAuth.php index 9e63256..a99ce6d 100644 --- a/src/Thybag/Auth/SharePointOnlineAuth.php +++ b/src/Thybag/Auth/SharePointOnlineAuth.php @@ -21,7 +21,7 @@ public function __doRequest($request, $location, $action, $version, $one_way = f // Set base headers $headers = array(); - $headers[] = "Content-Type: text/xml;"; + $headers[] = "Content-Type: text/xml; charset=utf-8"; $headers[] = "SOAPAction: \"{$action}\""; $curl = curl_init($location); @@ -133,7 +133,7 @@ protected function extractAuthCookies($result){ // Get the two auth cookies foreach($header_array as $header) { $loop = explode(":",$header); - if($loop[0] == 'Set-Cookie') { + if (strtolower($loop[0]) == 'set-cookie') { $authCookies[] = $loop[1]; } } diff --git a/src/Thybag/Service/QueryObjectService.php b/src/Thybag/Service/QueryObjectService.php index 281f6bd..5f0d175 100644 --- a/src/Thybag/Service/QueryObjectService.php +++ b/src/Thybag/Service/QueryObjectService.php @@ -68,7 +68,7 @@ public function __construct ($list_name, \Thybag\SharePointAPI $api) { * @param $col column to test * @param $test comparison type (=,!+,<,>) * @param $value to test with - * @return Ref to self + * @return $this */ public function where ($col, $test, $val) { return $this->addQueryLine('where', $col, $test, $val); @@ -81,7 +81,7 @@ public function where ($col, $test, $val) { * @param $col column to test * @param $test comparison type (=,!+,<,>) * @param $value to test with - * @return Ref to self + * @return $this */ public function and_where ($col, $test, $val) { return $this->addQueryLine('and', $col, $test, $val); @@ -94,7 +94,7 @@ public function and_where ($col, $test, $val) { * @param $col column to test * @param $test comparison type (=,!+,<,>) * @param $value to test with - * @return Ref to self + * @return $this */ public function or_where ($col, $test, $val) { return $this->addQueryLine('or', $col, $test, $val); @@ -106,7 +106,7 @@ public function or_where ($col, $test, $val) { * This can be used when a user needs to perform queries to complex to be defined using the standard methods * * @param $caml - RAW CAML - * @return Ref to self + * @return $this * @throws \Exception - Thrown if standard where states are already in use. */ public function raw_where ($caml) { @@ -121,7 +121,7 @@ public function raw_where ($caml) { * Specify maximum amount of items to return. (if not set, default is used.) * * @param $limit number of items to return - * @return Ref to self + * @return $this */ public function limit ($limit) { $this->limit = $limit; @@ -133,7 +133,7 @@ public function limit ($limit) { * Specify view to use when returning data. * * @param $view Name/GUID - * @return Ref to self + * @return $this */ public function using ($view) { $this->view = $view; @@ -145,8 +145,8 @@ public function using ($view) { * Specify view to use when returning data. * * @param String $options "XML string of query options." - * @return Ref to self - */ + * @return $this + */ public function options($options){ $this->options = $options; return $this; @@ -158,7 +158,7 @@ public function options($options){ * * @param $sort_on column to sort on * @param $order Sort direction - * @return Ref to self + * @return $this */ public function sort ($sort_on, $order = 'desc') { $queryString = ''; @@ -172,7 +172,7 @@ public function sort ($sort_on, $order = 'desc') { * array of fields to include in results * * @param $fields array - * @return Ref to self + * @return $this */ public function fields (array $fields) { $this->fields = $fields; @@ -185,7 +185,7 @@ public function columns ($fields) { return $this->fields($fields); } * Attempt to include all fields row has within result * * @param $exclude_hidden to to false to include hidden fields - * @return Ref to self + * @return $this */ public function all_fields($exclude_hidden = true){ $fields = $this->api->readListMeta($this->list_name, $exclude_hidden); @@ -218,7 +218,7 @@ public function get ($options = NULL) { * @param $col column to test * @param $test comparison type (=,!+,<,>,like) * @param $value value to test with - * @return Ref to self + * @return $this * @throws \Exception Thrown if $test is unrecognized */ private function addQueryLine ($rel, $col, $test, $value) {