You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default list item's are returned as arrays with lower case index's. If you would prefer the results to return as object's, before invoking any read operations use:
107
115
@@ -111,6 +119,7 @@ Automatically making the attribute names lowercase can also be deactivated by us
111
119
112
120
$sp->lowercaseIndexs(FALSE);
113
121
122
+
114
123
#### Querying a list
115
124
The query method can be used when you need to specify a query that is to complex to be easily defined using the read methods. Queries are constructed using a number of (hopefully expressive) pseudo SQL methods.
116
125
@@ -122,6 +131,10 @@ If you wanted to get the first 10 pets that were either cats or hamsters you cou
122
131
123
132
$sp->query('list of pets')->where('type','=','cat')->or_where('type','=','hamster')->limit(10)->get();
124
133
134
+
If you need to return 5 items, but including all fields contained in a list, you can use. (pass false to all_fields to include hidden fields).
135
+
136
+
$sp->query('list of pets')->all_fields()->get();
137
+
125
138
If you have a set of CAML for a specific advanced query you would like to run, you can pass it to the query object using:
126
139
127
140
$sp->query('list of pets')->raw_where('<Eq><FieldRef Name="Title" /><Value Type="Text">Hello World</Value></Eq>')->limit(10)->get();
@@ -206,7 +219,7 @@ Files can be attached to SharePoint list items using:
206
219
207
220
The PHP SharePoint API contains a number of helper methods to make it easier to ensure certain values are in the correct format for some of SharePoints special data types.
208
221
209
-
#### dateTime
222
+
######dateTime
210
223
211
224
The dataTime method can either be passed a text based date
212
225
@@ -218,7 +231,7 @@ Or a unix timestamp
218
231
219
232
And will return a value which can be stored in to SharePoints DateTime fields without issue.
220
233
221
-
#### Lookup
234
+
######Lookup
222
235
223
236
The lookup data type in SharePoint is for fields that reference a row in another list. In order to correctly populate these values you will need to know the ID of the row the value needs to reference.
224
237
@@ -228,7 +241,7 @@ If you do not know the name/title of the value you are storing the method will w
228
241
229
242
$value = \Thybag\SharepointApi::lookup('3');
230
243
231
-
#### Magic Lookup
244
+
######Magic Lookup
232
245
233
246
If you are attempting to store a value in a "lookup" data type but for some reason only know the title/name of the item, not its ID, you can use the MagicLookup method to quickly look this value up and return it for you. This method will need to be passed both the items title & the list it is contained within.
0 commit comments