Skip to content

Commit 7b0d6dc

Browse files
authored
Merge pull request #165 from thybag/develop
Create release with community fixes
2 parents cf5cae5 + e697991 commit 7b0d6dc

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

readme.md

+3
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ As with the write method you can also run multiple update operations together by
168168

169169
When using updateMultiple every item MUST have an ID.
170170

171+
> :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.
172+
> It is therefore not recommended to use this as a check to ensure a successful update.
173+
171174
#### Deleting Rows
172175

173176
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:

src/Thybag/Auth/SharePointOnlineAuth.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function __doRequest($request, $location, $action, $version, $one_way = f
2121

2222
// Set base headers
2323
$headers = array();
24-
$headers[] = "Content-Type: text/xml;";
24+
$headers[] = "Content-Type: text/xml; charset=utf-8";
2525
$headers[] = "SOAPAction: \"{$action}\"";
2626

2727
$curl = curl_init($location);
@@ -133,7 +133,7 @@ protected function extractAuthCookies($result){
133133
// Get the two auth cookies
134134
foreach($header_array as $header) {
135135
$loop = explode(":",$header);
136-
if($loop[0] == 'Set-Cookie') {
136+
if (strtolower($loop[0]) == 'set-cookie') {
137137
$authCookies[] = $loop[1];
138138
}
139139
}

src/Thybag/Service/QueryObjectService.php

+12-12
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function __construct ($list_name, \Thybag\SharePointAPI $api) {
6868
* @param $col column to test
6969
* @param $test comparison type (=,!+,<,>)
7070
* @param $value to test with
71-
* @return Ref to self
71+
* @return $this
7272
*/
7373
public function where ($col, $test, $val) {
7474
return $this->addQueryLine('where', $col, $test, $val);
@@ -81,7 +81,7 @@ public function where ($col, $test, $val) {
8181
* @param $col column to test
8282
* @param $test comparison type (=,!+,<,>)
8383
* @param $value to test with
84-
* @return Ref to self
84+
* @return $this
8585
*/
8686
public function and_where ($col, $test, $val) {
8787
return $this->addQueryLine('and', $col, $test, $val);
@@ -94,7 +94,7 @@ public function and_where ($col, $test, $val) {
9494
* @param $col column to test
9595
* @param $test comparison type (=,!+,<,>)
9696
* @param $value to test with
97-
* @return Ref to self
97+
* @return $this
9898
*/
9999
public function or_where ($col, $test, $val) {
100100
return $this->addQueryLine('or', $col, $test, $val);
@@ -106,7 +106,7 @@ public function or_where ($col, $test, $val) {
106106
* This can be used when a user needs to perform queries to complex to be defined using the standard methods
107107
*
108108
* @param $caml - RAW CAML
109-
* @return Ref to self
109+
* @return $this
110110
* @throws \Exception - Thrown if standard where states are already in use.
111111
*/
112112
public function raw_where ($caml) {
@@ -121,7 +121,7 @@ public function raw_where ($caml) {
121121
* Specify maximum amount of items to return. (if not set, default is used.)
122122
*
123123
* @param $limit number of items to return
124-
* @return Ref to self
124+
* @return $this
125125
*/
126126
public function limit ($limit) {
127127
$this->limit = $limit;
@@ -133,7 +133,7 @@ public function limit ($limit) {
133133
* Specify view to use when returning data.
134134
*
135135
* @param $view Name/GUID
136-
* @return Ref to self
136+
* @return $this
137137
*/
138138
public function using ($view) {
139139
$this->view = $view;
@@ -145,8 +145,8 @@ public function using ($view) {
145145
* Specify view to use when returning data.
146146
*
147147
* @param String $options "XML string of query options."
148-
* @return Ref to self
149-
*/
148+
* @return $this
149+
*/
150150
public function options($options){
151151
$this->options = $options;
152152
return $this;
@@ -158,7 +158,7 @@ public function options($options){
158158
*
159159
* @param $sort_on column to sort on
160160
* @param $order Sort direction
161-
* @return Ref to self
161+
* @return $this
162162
*/
163163
public function sort ($sort_on, $order = 'desc') {
164164
$queryString = '<FieldRef Name="' .$sort_on . '" Ascending="' . $this->api->getSortFromValue($order) . '" />';
@@ -172,7 +172,7 @@ public function sort ($sort_on, $order = 'desc') {
172172
* array of fields to include in results
173173
*
174174
* @param $fields array
175-
* @return Ref to self
175+
* @return $this
176176
*/
177177
public function fields (array $fields) {
178178
$this->fields = $fields;
@@ -185,7 +185,7 @@ public function columns ($fields) { return $this->fields($fields); }
185185
* Attempt to include all fields row has within result
186186
*
187187
* @param $exclude_hidden to to false to include hidden fields
188-
* @return Ref to self
188+
* @return $this
189189
*/
190190
public function all_fields($exclude_hidden = true){
191191
$fields = $this->api->readListMeta($this->list_name, $exclude_hidden);
@@ -218,7 +218,7 @@ public function get ($options = NULL) {
218218
* @param $col column to test
219219
* @param $test comparison type (=,!+,<,>,like)
220220
* @param $value value to test with
221-
* @return Ref to self
221+
* @return $this
222222
* @throws \Exception Thrown if $test is unrecognized
223223
*/
224224
private function addQueryLine ($rel, $col, $test, $value) {

0 commit comments

Comments
 (0)