1 | <?php |
||
25 | trait SelectableTrait |
||
26 | { |
||
27 | |||
28 | private $_select = []; |
||
29 | |||
30 | /** |
||
31 | * List of fields to get from DB |
||
32 | * Multiple calls to this method will merge all given fields |
||
33 | * |
||
34 | * @param array $fields list of fields to select |
||
35 | * @return CriteriaInterface |
||
36 | */ |
||
37 | public function select(array $fields = null) |
||
45 | |||
46 | /** |
||
47 | * Return selected fields |
||
48 | * @return bool[] Fields used for select |
||
49 | * @since v1.3.1 |
||
50 | */ |
||
51 | 102 | public function getSelect() |
|
55 | |||
56 | /** |
||
57 | * Set fields to select. |
||
58 | * Pass array with field names as keys and true as value, ie: |
||
59 | * ```php |
||
60 | * $criteria->setSelect(['_id' => true, 'title' => true]); |
||
61 | * ``` |
||
62 | * |
||
63 | * NOTE: This resets entire select |
||
64 | * |
||
65 | * @param bool[] $select Fields to select |
||
66 | * @return CriteriaInterface |
||
67 | */ |
||
68 | 4 | public function setSelect(array $select) |
|
85 | |||
86 | } |
||
87 |