1 | <?php |
||
15 | class ColumnConfiguration |
||
16 | { |
||
17 | |||
18 | /** |
||
19 | * @var string The internal name of the column configuration |
||
20 | */ |
||
21 | private $name; |
||
22 | |||
23 | /** |
||
24 | * @var Searchable Determines if the column can be searched on or not |
||
25 | */ |
||
26 | private $searchable; |
||
27 | |||
28 | /** |
||
29 | * @var Orderable Determines if the column can be ordered on or not |
||
30 | */ |
||
31 | private $orderable; |
||
32 | |||
33 | /** |
||
34 | * @var callable The function the user defines that should be called when the value of the columns should be calculated |
||
35 | */ |
||
36 | private $callable; |
||
37 | |||
38 | /** |
||
39 | * ColumnConfiguration constructor. |
||
40 | * As the class is immutable, all properties have to be set here |
||
41 | * |
||
42 | * @param string $name The internal name of the column configuration |
||
43 | * @param callable $callable the function to call when the value should be calculated |
||
44 | * @param Searchable $isSearchable If the column should be searchable |
||
45 | * @param Orderable $isOrderable If the column should be orderable |
||
46 | */ |
||
47 | public function __construct($name, $callable, Searchable $isSearchable, Orderable $isOrderable) |
||
54 | |||
55 | /** |
||
56 | * Will return the searchable column configuration |
||
57 | * |
||
58 | * @return Searchable |
||
59 | */ |
||
60 | public function getSearch() |
||
64 | |||
65 | /** |
||
66 | * Will return the orderable column configuration |
||
67 | * |
||
68 | * @return Orderable |
||
69 | */ |
||
70 | public function getOrder() |
||
74 | |||
75 | /** |
||
76 | * Will return the internal name of this column configuration |
||
77 | * |
||
78 | * @return string |
||
79 | */ |
||
80 | public function getName() |
||
84 | |||
85 | /** |
||
86 | * Will return the function that will be executed upon calculation. |
||
87 | * |
||
88 | * @return callable |
||
89 | */ |
||
90 | public function getCallable() |
||
94 | } |