1 | <?php |
||
7 | class PrimaryKey implements ConstraintInterface |
||
8 | { |
||
9 | private $columns; |
||
10 | private $isAutoIncrement = true; |
||
11 | private $autoCreateColumn = false; |
||
12 | private $table; |
||
13 | |||
14 | /** |
||
15 | * Constructor. |
||
16 | * |
||
17 | * @param array|string $columns Column names. |
||
18 | * @param Table $table Table instance. |
||
19 | */ |
||
20 | public function __construct($columns = null, Table $table = null) |
||
28 | |||
29 | /** |
||
30 | * {@inheritdoc} |
||
31 | */ |
||
32 | public function getName() |
||
36 | |||
37 | // TODO hmmmmmm.... |
||
38 | public function getColumns() |
||
44 | |||
45 | /** |
||
46 | * Return true if the primary key is auto create column. |
||
47 | * |
||
48 | * @return bool Auto create column |
||
49 | */ |
||
50 | public function isAutoCreateColumn() |
||
54 | |||
55 | /** |
||
56 | * Return true if the primary key is multi. |
||
57 | * |
||
58 | * @return bool Multi columns. |
||
59 | */ |
||
60 | public function isMulti() |
||
64 | |||
65 | /** |
||
66 | * Disable auto increment. |
||
67 | * |
||
68 | * @return PrimaryKey Self. |
||
69 | */ |
||
70 | public function disableAutoIncrement() |
||
76 | |||
77 | /** |
||
78 | * Return true if the primary key is auto increment. |
||
79 | * |
||
80 | * @return bool Auto increment. |
||
81 | */ |
||
82 | public function isAutoIncrement() |
||
86 | |||
87 | // TODO Remove this code |
||
88 | public function __toString() |
||
95 | |||
96 | /** |
||
97 | * {@inheritdoc} |
||
98 | */ |
||
99 | public function getTable() |
||
103 | |||
104 | /** |
||
105 | * Set table instance. |
||
106 | * |
||
107 | * @param Table $table Table instance. |
||
108 | * |
||
109 | * @return PrimaryKey Self. |
||
110 | */ |
||
111 | public function setTable(Table $table) |
||
117 | } |
||
118 |