1 | <?php |
||
9 | class ColumnCollection implements ArrayAccess, IteratorAggregate |
||
10 | { |
||
11 | /** @var array */ |
||
12 | protected $columns = []; |
||
13 | |||
14 | /** |
||
15 | * Create new searchable columns collection. |
||
16 | * |
||
17 | * @param array $columns |
||
18 | */ |
||
19 | public function __construct(array $columns = []) |
||
25 | |||
26 | /** |
||
27 | * Get columns as plain array. |
||
28 | * |
||
29 | * @return array |
||
30 | */ |
||
31 | public function getColumns() |
||
35 | |||
36 | /** |
||
37 | * Add column to the collection. |
||
38 | * |
||
39 | * @param \Sofa\Eloquence\Searchable\Column $column |
||
40 | */ |
||
41 | public function add(Column $column) |
||
45 | |||
46 | /** |
||
47 | * Get array of qualified columns names. |
||
48 | * |
||
49 | * @return array |
||
50 | */ |
||
51 | public function getQualifiedNames() |
||
57 | |||
58 | /** |
||
59 | * Get array of tables names. |
||
60 | * |
||
61 | * @return array |
||
62 | */ |
||
63 | public function getTables() |
||
69 | |||
70 | /** |
||
71 | * Get array of columns mappings and weights. |
||
72 | * |
||
73 | * @return array |
||
74 | */ |
||
75 | public function getWeights() |
||
85 | |||
86 | /** |
||
87 | * Get array of columns mappings. |
||
88 | * |
||
89 | * @return array |
||
90 | */ |
||
91 | public function getMappings() |
||
97 | |||
98 | /** |
||
99 | * Check if element exists at given offset. |
||
100 | * |
||
101 | * @param string $key |
||
102 | * @return boolean |
||
103 | */ |
||
104 | public function offsetExists($key) |
||
108 | |||
109 | /** |
||
110 | * Get element at given offset. |
||
111 | * |
||
112 | * @param string $key |
||
113 | * @return \Sofa\Eloquence\Searchable\Column |
||
114 | */ |
||
115 | public function offsetGet($key) |
||
119 | |||
120 | /** |
||
121 | * Set element at given offset. |
||
122 | * |
||
123 | * @param string $key [description] |
||
124 | * @param \Sofa\Eloquence\Searchable\Column $column |
||
125 | * @return void |
||
126 | */ |
||
127 | public function offsetSet($key, $column) |
||
131 | |||
132 | /** |
||
133 | * Unset element at given offset. |
||
134 | * |
||
135 | * @param string $key |
||
136 | * @return \Sofa\Eloquence\Searchable\Column |
||
137 | */ |
||
138 | public function offsetUnset($key) |
||
142 | |||
143 | /** |
||
144 | * Get an iterator for the columns. |
||
145 | * |
||
146 | * @return \ArrayIterator |
||
147 | */ |
||
148 | public function getIterator() |
||
152 | } |
||
153 |