| @@ 500-516 (lines=17) @@ | ||
| 497 | /** |
|
| 498 | * {@inheritdoc} |
|
| 499 | */ |
|
| 500 | public function hasIndex($tableName, $columns) |
|
| 501 | { |
|
| 502 | if (is_string($columns)) { |
|
| 503 | $columns = [$columns]; // str to array |
|
| 504 | } |
|
| 505 | ||
| 506 | $columns = array_map('strtolower', $columns); |
|
| 507 | $indexes = $this->getIndexes($tableName); |
|
| 508 | ||
| 509 | foreach ($indexes as $index) { |
|
| 510 | if ($columns == $index['columns']) { |
|
| 511 | return true; |
|
| 512 | } |
|
| 513 | } |
|
| 514 | ||
| 515 | return false; |
|
| 516 | } |
|
| 517 | ||
| 518 | /** |
|
| 519 | * {@inheritdoc} |
|
| @@ 547-559 (lines=13) @@ | ||
| 544 | /** |
|
| 545 | * {@inheritdoc} |
|
| 546 | */ |
|
| 547 | public function hasIndex($tableName, $columns) |
|
| 548 | { |
|
| 549 | if (is_string($columns)) { |
|
| 550 | $columns = [$columns]; |
|
| 551 | } |
|
| 552 | $indexes = $this->getIndexes($tableName); |
|
| 553 | foreach ($indexes as $index) { |
|
| 554 | if (array_diff($index['columns'], $columns) === array_diff($columns, $index['columns'])) { |
|
| 555 | return true; |
|
| 556 | } |
|
| 557 | } |
|
| 558 | return false; |
|
| 559 | } |
|
| 560 | ||
| 561 | /** |
|
| 562 | * {@inheritdoc} |
|