| Total Complexity | 6 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | trait CompilesViews |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * Compile the query to create a view. |
||
| 9 | * |
||
| 10 | * @param string $name |
||
| 11 | * @param string $query |
||
| 12 | * @param array|null $columns |
||
| 13 | * @param bool $orReplace |
||
| 14 | * @return string |
||
| 15 | */ |
||
| 16 | 40 | public function compileCreateView($name, $query, $columns, $orReplace) |
|
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Compile the query to drop a view. |
||
| 27 | * |
||
| 28 | * @param string $name |
||
| 29 | * @param bool $ifExists |
||
| 30 | * @return string |
||
| 31 | */ |
||
| 32 | 33 | public function compileDropView($name, $ifExists) |
|
| 33 | { |
||
| 34 | 33 | $ifExists = $ifExists ? 'if exists ' : ''; |
|
| 35 | |||
| 36 | 33 | return 'drop view '.$ifExists.$this->wrapTable($name); |
|
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Compile the query to determine if a view exists. |
||
| 41 | * |
||
| 42 | * @return string |
||
| 43 | */ |
||
| 44 | 6 | public function compileViewExists() |
|
| 47 | } |
||
| 48 | } |
||
| 49 |