mirror of
https://codeberg.org/icewind/SearchDAV.git
synced 2026-06-03 17:44:06 +02:00
Seperate query classes from xml classes to allow specifying more information in the query
This commit is contained in:
parent
82bcf2cebb
commit
5ad4d24b89
17 changed files with 509 additions and 112 deletions
|
|
@ -26,9 +26,6 @@ use Sabre\Xml\Reader;
|
|||
use Sabre\Xml\XmlDeserializable;
|
||||
|
||||
class Order implements XmlDeserializable {
|
||||
const ASC = 'ascending';
|
||||
const DESC = 'descending';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
|
|
@ -48,7 +45,7 @@ class Order implements XmlDeserializable {
|
|||
* @param string $property
|
||||
* @param string $order
|
||||
*/
|
||||
public function __construct($property = '', $order = self::ASC) {
|
||||
public function __construct($property = '', $order = \SearchDAV\Query\Order::ASC) {
|
||||
$this->property = $property;
|
||||
$this->order = $order;
|
||||
}
|
||||
|
|
@ -58,7 +55,7 @@ class Order implements XmlDeserializable {
|
|||
|
||||
$childs = \Sabre\Xml\Deserializer\keyValue($reader);
|
||||
|
||||
$order->order = array_key_exists('{DAV:}descending', $childs) ? self::DESC : self::ASC;
|
||||
$order->order = array_key_exists('{DAV:}descending', $childs) ? \SearchDAV\Query\Order::DESC : \SearchDAV\Query\Order::ASC;
|
||||
$order->property = $childs['{DAV:}prop'][0];
|
||||
|
||||
return $order;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue