1 | <?php |
||
8 | class Table extends AbstractBuilder implements Buildable |
||
9 | { |
||
10 | /** |
||
11 | * @var array |
||
12 | */ |
||
13 | protected $primaryTable = []; |
||
14 | |||
15 | /** |
||
16 | * @param ClassMetadataBuilder $builder |
||
17 | * @param string|callable|null $name |
||
18 | */ |
||
19 | 13 | public function __construct(ClassMetadataBuilder $builder, $name = null) |
|
29 | |||
30 | /** |
||
31 | * @param string $name |
||
32 | * |
||
33 | * @return $this |
||
34 | */ |
||
35 | 13 | public function setName($name) |
|
41 | |||
42 | /** |
||
43 | * @param string $schema |
||
44 | * |
||
45 | * @return $this |
||
46 | */ |
||
47 | 3 | public function schema($schema) |
|
53 | |||
54 | /** |
||
55 | * @param string $charset |
||
56 | * |
||
57 | * @return $this |
||
58 | */ |
||
59 | 2 | public function charset($charset) |
|
60 | { |
||
61 | 2 | $this->option('charset', $charset); |
|
62 | |||
63 | 2 | return $this; |
|
64 | } |
||
65 | |||
66 | /** |
||
67 | * @param string $collate |
||
68 | * |
||
69 | * @return $this |
||
70 | */ |
||
71 | 2 | public function collate($collate) |
|
72 | { |
||
73 | 2 | $this->option('collate', $collate); |
|
74 | |||
75 | 2 | return $this; |
|
76 | } |
||
77 | |||
78 | /** |
||
79 | * @param array $options |
||
80 | * |
||
81 | * @return $this |
||
82 | */ |
||
83 | 3 | public function options(array $options = []) |
|
89 | |||
90 | /** |
||
91 | * @param string $name |
||
92 | * @param string $value |
||
93 | * |
||
94 | * @return $this |
||
95 | */ |
||
96 | 3 | public function option($name, $value) |
|
97 | { |
||
98 | 3 | $this->primaryTable['options'][$name] = $value; |
|
99 | |||
100 | 3 | return $this; |
|
101 | } |
||
102 | |||
103 | /** |
||
104 | * Execute the build process |
||
105 | */ |
||
106 | 8 | public function build() |
|
110 | } |
||
111 |