Skip to content

Commit

Permalink
Merge pull request #165 from thybag/develop
Browse files Browse the repository at this point in the history
Create release with community fixes
  • Loading branch information
thybag authored Sep 27, 2020
2 parents cf5cae5 + e697991 commit 7b0d6dc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
3 changes: 3 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/Thybag/Auth/SharePointOnlineAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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];
}
}
Expand Down
24 changes: 12 additions & 12 deletions src/Thybag/Service/QueryObjectService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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) {
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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 = '<FieldRef Name="' .$sort_on . '" Ascending="' . $this->api->getSortFromValue($order) . '" />';
Expand All @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 7b0d6dc

Please sign in to comment.