| Total Complexity | 9 |
| Total Lines | 68 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | abstract class Q extends AbstractExpression |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var array|string|Q |
||
| 11 | */ |
||
| 12 | protected $where; |
||
| 13 | /** |
||
| 14 | * @var string |
||
| 15 | */ |
||
| 16 | protected $operator = 'AND'; |
||
| 17 | |||
| 18 | public function __construct($where) |
||
| 19 | { |
||
| 20 | $this->where = $where; |
||
| 21 | } |
||
| 22 | |||
| 23 | public function getWhere() |
||
| 24 | { |
||
| 25 | return $this->where; |
||
| 26 | } |
||
| 27 | |||
| 28 | public function addWhere($where) |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @return string |
||
| 36 | */ |
||
| 37 | public function getOperator() |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @return string |
||
| 44 | */ |
||
| 45 | public function toSQL() |
||
| 46 | { |
||
| 47 | return $this->parseConditions($this->where); |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @param array $where |
||
| 52 | * @return string |
||
| 53 | */ |
||
| 54 | protected function parseConditions($where) |
||
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * @param $part |
||
| 65 | * @param null|string $operator |
||
| 66 | * @return string |
||
| 67 | */ |
||
| 68 | protected function parsePart($part, $operator = null) |
||
| 75 | } |
||
| 76 | } |