Total Complexity | 10 |
Total Lines | 63 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class View extends \yentu\database\DatabaseItem |
||
8 | { |
||
9 | private $name; |
||
10 | private $schema; |
||
11 | |||
12 | public $definition; |
||
13 | |||
14 | public function __construct($name, $schema) |
||
15 | { |
||
16 | $this->name = $name; |
||
17 | $this->schema = $schema; |
||
18 | } |
||
19 | |||
20 | #[\Override] |
||
21 | public function init() |
||
22 | { |
||
23 | $this->definition = $this->getDriver()->doesViewExist($this->buildDescription()); |
||
|
|||
24 | if($this->definition === false) |
||
25 | { |
||
26 | $this->new = true; |
||
27 | } |
||
28 | } |
||
29 | |||
30 | public function drop() |
||
34 | } |
||
35 | |||
36 | public function commitNew() |
||
37 | { |
||
38 | |||
39 | } |
||
40 | |||
41 | public function definition($definition) |
||
42 | { |
||
43 | $this->addChange('definition', 'definition', $definition); |
||
44 | |||
45 | if($this->isNew()) |
||
46 | { |
||
47 | $this->getDriver()->addView($this->buildDescription()); |
||
48 | } |
||
49 | return $this; |
||
50 | } |
||
51 | |||
52 | public function view($name) |
||
56 | } |
||
57 | |||
58 | public function table($name) |
||
62 | } |
||
63 | |||
64 | #[\Override] |
||
73 |