1: <?php
2:
3: namespace PHPixie\Database\Values;
4:
5: class OrderBy
6: {
7: protected $field;
8: protected $direction;
9:
10: public function __construct($field, $direction)
11: {
12: if(!in_array($direction, array('asc', 'desc')))
13: throw new \PHPixie\Database\Exception\Value("Invalid order direction '$direction'");
14:
15: $this->field = $field;
16: $this->direction = $direction;
17: }
18:
19: public function field()
20: {
21: return $this->field;
22: }
23:
24: public function direction()
25: {
26: return $this->direction;
27: }
28: }