Download the PHP package dcarbone/camel without Composer
On this page you can find all versions of the php package dcarbone/camel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dcarbone/camel
More information about dcarbone/camel
Files in dcarbone/camel
Package camel
Short Description A library designed to help facilitate SharePoint CAML query construction
License MPL-2.0
Homepage https://github.com/dcarbone/camel
Informations about the package camel
camel
A library designed to help facilitate SharePoint CAML query construction
Build Status
Install
Initialization
To begin, simply create a new Camel.
Humps
Once you have created your Camel, you start adding humps!
There are 3 types of humps:
You may add them to your Camel in one of two ways:
The same applies for all humps, and both are perfectly acceptable ways of going about it.
Nodes
There are 3 primary types of nodes:
Here is a quick breakdown of each:
ComparisonOperator
These will probably be the most commonly used nodes in your Camel. I believe I have implemented every possible Comparison Operator supported by the SharePoint CAML query system. If I missed one, let me know!
LogicalJoin
There are only two of these:
To keep things DRY, I have most of the logic necessary for these nodes in their base class:
ValueNode
These nodes are typically only used inside of the aforementioned ComparisonOperator nodes, and allow you to compare an input value to a column / etc. in your list.
Each ComparisonOperator has a distinct list of allowable ValueNodes, so check their class definition to see what they are.
Simple Example
Lets say you have a SharePoint list that looks somewhat like this:
Title | Age | Gender | Profession |
---|---|---|---|
Daniel | 28 | Male | Software Developer |
Elizabeth | 25 | Female | Project Manager |
David | 59 | Male | Oncologist |
Beatrice | 22 | Female | Med Student |
Anna | 20 | Female | Retail |
And you want to get all the females back. You could do something like this:
The above would produce the following:
You can also do logical joins.
The above will produce:
You may also nest to your heart's content.
Which produces:
Conclusion and Future Development
At the moment, this library serves my needs. If you find this library useful and would like to see something added or changed, please let me know!