Total Complexity | 7 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class DocumentSorter |
||
12 | { |
||
13 | protected static $orderByField; |
||
14 | protected static $order = 'ASC'; |
||
15 | |||
16 | /** |
||
17 | * Sorts an array of Document instances |
||
18 | * @param array $documents |
||
19 | * @param string $field |
||
20 | * @param string $order |
||
21 | * @return array |
||
22 | */ |
||
23 | public static function sortDocumentsByField($documents, $field, $order = 'ASC') |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * Compares two documents |
||
36 | * @param Document $a |
||
37 | * @param Document $b |
||
38 | * @return int |
||
39 | */ |
||
40 | protected static function fieldCompare(Document $a, Document $b) { |
||
55 | } |
||
56 | } |