File size: 1,212 Bytes
07c3cdd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php

class EntitySolrRequestData extends EntityBase
{
    public $workspace = '';
    public $startAfter = 0;
    public $pageSize = 10;
    public $searchText = '*:*';
    public $filterText = ''; // comma separated list of filters field:value
    public $numSortingCols = 0; // number of columns that are sorted
    public $sortableCols = array(); // array of booleans indicating if column is
    // sortable (true, false)
    public $sortCols = array(); // array of indices of sorted columns index
    // based in the total number of sorting cols
    public $sortDir = array(); // array of direction of sorting for each
    // column (desc, asc)
    public $includeCols = array();
    public $resultFormat = 'xml'; // json, xml, php

    private function __construct()
    {
    }

    public static function createEmpty()
    {
        $obj = new EntitySolrRequestData();
        return $obj;
    }

    public static function createForRequestPagination($data)
    {
        $obj = new EntitySolrRequestData();

        $obj->initializeObject($data);

        $requiredFields = array(
            'workspace'
        );

        $obj->validateRequiredFields($requiredFields);

        return $obj;
    }
}