mirror of
https://codeberg.org/icewind/SearchDAV.git
synced 2026-06-04 01:54:07 +02:00
Documentation
This commit is contained in:
parent
88db2ae6c1
commit
3f23e989f0
8 changed files with 152 additions and 21 deletions
|
|
@ -24,11 +24,14 @@ namespace SearchDAV\XML;
|
|||
use Sabre\Xml\Reader;
|
||||
use Sabre\Xml\XmlDeserializable;
|
||||
|
||||
/**
|
||||
* The object representation of a search query made by the client
|
||||
*/
|
||||
class BasicSearch implements XmlDeserializable {
|
||||
/**
|
||||
* @var string[]
|
||||
*
|
||||
* The list of properties to be selected in clark notation
|
||||
* The list of properties to be selected, specified in clark notation
|
||||
*/
|
||||
public $select;
|
||||
/**
|
||||
|
|
@ -38,11 +41,20 @@ class BasicSearch implements XmlDeserializable {
|
|||
*/
|
||||
public $from;
|
||||
/**
|
||||
* @var Operator[]
|
||||
* @var Operator
|
||||
*
|
||||
* The search operator, either a comparison ('gt', 'eq', ...) or a boolean operator ('and', 'or', 'not')
|
||||
*/
|
||||
public $where;
|
||||
/**
|
||||
* @var Order[]
|
||||
*
|
||||
* The list of order operations that should be used to order the results.
|
||||
*
|
||||
* Each order operations consists of a property to sort on and a sort direction.
|
||||
* If more then one order operations are specified, the comparisons for ordering should
|
||||
* be applied in the order that the order operations are defined in with the earlier comparisons being
|
||||
* more significant.
|
||||
*/
|
||||
public $orderBy;
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ class Operator implements XmlDeserializable {
|
|||
* - string: property name for comparison
|
||||
* - Literal: literal value for comparison
|
||||
* - Operation: nested operation for and/or/not operations
|
||||
*
|
||||
* Which type and what number of argument an Operator takes depends on the operator type.
|
||||
*/
|
||||
public $arguments;
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,17 @@ class Order implements XmlDeserializable {
|
|||
const ASC = 'ascending';
|
||||
const DESC = 'descending';
|
||||
|
||||
public $properties;
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* The property that should be sorted on.
|
||||
*/
|
||||
public $property;
|
||||
/**
|
||||
* @var string 'ascending' or 'descending'
|
||||
*
|
||||
* The sort direction
|
||||
*/
|
||||
public $order;
|
||||
|
||||
static function xmlDeserialize(Reader $reader) {
|
||||
|
|
@ -38,7 +48,7 @@ class Order implements XmlDeserializable {
|
|||
$childs = \Sabre\Xml\Deserializer\keyValue($reader);
|
||||
|
||||
$order->order = isset($childs['{DAV:}descending']) ? self::DESC : self::ASC;
|
||||
$order->properties = $childs['{DAV:}prop'];
|
||||
$order->property = $childs['{DAV:}prop'][0];
|
||||
|
||||
return $order;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,20 @@ use Sabre\Xml\Reader;
|
|||
use Sabre\Xml\XmlDeserializable;
|
||||
|
||||
class Scope implements XmlDeserializable {
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* The absolute url of the search scope
|
||||
*/
|
||||
public $href;
|
||||
|
||||
/**
|
||||
* @var string|int 0, 1 or 'infinite'
|
||||
*
|
||||
* How deep the search query should be with 0 being only the scope itself,
|
||||
* 1 being all direct child entries of the scope and infinite being all entries
|
||||
* in the scope collection at any depth.
|
||||
*/
|
||||
public $depth;
|
||||
|
||||
static function xmlDeserialize(Reader $reader) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue