ntentan /
yentu
| 1 | <?php |
||
| 2 | |||
| 3 | namespace yentu\database; |
||
| 4 | |||
| 5 | use yentu\database\ItemType; |
||
| 6 | |||
| 7 | |||
| 8 | class Begin extends DatabaseItem |
||
| 9 | { |
||
| 10 | private Schema $defaultSchema; |
||
| 11 | private EncapsulatedStack $encapsulatedStack; |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 12 | |||
| 13 | public function __construct(Schema $defaultSchema) |
||
| 14 | { |
||
| 15 | $this->defaultSchema = $defaultSchema; |
||
| 16 | // $this->encapsulatedStack = $encapsulatedStack; |
||
| 17 | } |
||
| 18 | |||
| 19 | public function table(string $name): DatabaseItem |
||
| 20 | { |
||
| 21 | return $this->factory->create(ItemType::Table, $name, $this); |
||
| 22 | } |
||
| 23 | |||
| 24 | public function schema(string $name): DatabaseItem |
||
| 25 | { |
||
| 26 | return $this->factory->create(ItemType::Schema, $name, $this); |
||
| 27 | } |
||
| 28 | |||
| 29 | public function view(string $name): DatabaseItem |
||
| 30 | { |
||
| 31 | return $this->factory->create(ItemType::View, $name, $this); |
||
| 32 | } |
||
| 33 | |||
| 34 | public function getName(): string |
||
| 35 | { |
||
| 36 | return $this->defaultSchema->getName(); |
||
| 37 | } |
||
| 38 | |||
| 39 | public function end(): void |
||
| 40 | { |
||
| 41 | $this->getStack()->purge(); |
||
| 42 | } |
||
| 43 | |||
| 44 | public function query(string $query, $bindData = array()): DatabaseItem |
||
| 45 | { |
||
| 46 | return $this->factory->create(ItemType::Query, $query, $bindData); |
||
| 47 | } |
||
| 48 | } |
||
| 49 |