ntentan /
yentu
| 1 | <?php |
||||
| 2 | namespace yentu\database; |
||||
| 3 | |||||
| 4 | |||||
| 5 | class Index extends BasicKey |
||||
| 6 | { |
||||
| 7 | protected $unique = false; |
||||
| 8 | |||||
| 9 | public function unique($unique = true) |
||||
| 10 | { |
||||
| 11 | $this->unique = $unique; |
||||
| 12 | return $this; |
||||
| 13 | } |
||||
| 14 | |||||
| 15 | #[\Override] |
||||
| 16 | protected function doesKeyExist($constraint) |
||||
| 17 | { |
||||
| 18 | return $this->getChangeLogger()->doesIndexExist($constraint); |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 19 | } |
||||
| 20 | |||||
| 21 | #[\Override] |
||||
| 22 | protected function addKey($constraint) |
||||
| 23 | { |
||||
| 24 | $this->getChangeLogger()->addIndex($constraint); |
||||
|
0 ignored issues
–
show
The method
addIndex() does not exist on yentu\ChangeLogger. Since you implemented __call, consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 25 | } |
||||
| 26 | |||||
| 27 | #[\Override] |
||||
| 28 | protected function dropKey($constraint) |
||||
| 29 | { |
||||
| 30 | $this->getChangeLogger()->dropIndex($constraint); |
||||
|
0 ignored issues
–
show
The method
dropIndex() does not exist on yentu\ChangeLogger. Since you implemented __call, consider adding a @method annotation.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 31 | } |
||||
| 32 | |||||
| 33 | #[\Override] |
||||
| 34 | protected function getNamePostfix() |
||||
| 35 | { |
||||
| 36 | return 'idx'; |
||||
| 37 | } |
||||
| 38 | |||||
| 39 | #[\Override] |
||||
| 40 | public function buildDescription() |
||||
| 41 | { |
||||
| 42 | return parent::buildDescription() + ['unique' => $this->unique]; |
||||
| 43 | } |
||||
| 44 | } |
||||
| 45 |