| @@ 644-657 (lines=14) @@ | ||
| 641 | /** |
|
| 642 | * {@inheritdoc} |
|
| 643 | */ |
|
| 644 | public function hasIndex($tableName, $columns) |
|
| 645 | { |
|
| 646 | if (is_string($columns)) { |
|
| 647 | $columns = [$columns]; |
|
| 648 | } |
|
| 649 | $indexes = $this->getIndexes($tableName); |
|
| 650 | foreach ($indexes as $index) { |
|
| 651 | if (array_diff($index['columns'], $columns) === array_diff($columns, $index['columns'])) { |
|
| 652 | return true; |
|
| 653 | } |
|
| 654 | } |
|
| 655 | ||
| 656 | return false; |
|
| 657 | } |
|
| 658 | ||
| 659 | /** |
|
| 660 | * {@inheritdoc} |
|
| @@ 705-723 (lines=19) @@ | ||
| 702 | /** |
|
| 703 | * {@inheritdoc} |
|
| 704 | */ |
|
| 705 | public function hasIndex($tableName, $columns) |
|
| 706 | { |
|
| 707 | if (is_string($columns)) { |
|
| 708 | $columns = [$columns]; // str to array |
|
| 709 | } |
|
| 710 | ||
| 711 | $columns = array_map('strtolower', $columns); |
|
| 712 | $indexes = $this->getIndexes($tableName); |
|
| 713 | ||
| 714 | foreach ($indexes as $index) { |
|
| 715 | $a = array_diff($columns, $index['columns']); |
|
| 716 | ||
| 717 | if (empty($a)) { |
|
| 718 | return true; |
|
| 719 | } |
|
| 720 | } |
|
| 721 | ||
| 722 | return false; |
|
| 723 | } |
|
| 724 | ||
| 725 | /** |
|
| 726 | * {@inheritdoc} |
|
| @@ 537-553 (lines=17) @@ | ||
| 534 | /** |
|
| 535 | * {@inheritdoc} |
|
| 536 | */ |
|
| 537 | public function hasIndex($tableName, $columns) |
|
| 538 | { |
|
| 539 | if (is_string($columns)) { |
|
| 540 | $columns = [$columns]; // str to array |
|
| 541 | } |
|
| 542 | ||
| 543 | $columns = array_map('strtolower', $columns); |
|
| 544 | $indexes = $this->getIndexes($tableName); |
|
| 545 | ||
| 546 | foreach ($indexes as $index) { |
|
| 547 | if ($columns == $index['columns']) { |
|
| 548 | return true; |
|
| 549 | } |
|
| 550 | } |
|
| 551 | ||
| 552 | return false; |
|
| 553 | } |
|
| 554 | ||
| 555 | /** |
|
| 556 | * {@inheritdoc} |
|
| @@ 641-658 (lines=18) @@ | ||
| 638 | /** |
|
| 639 | * {@inheritdoc} |
|
| 640 | */ |
|
| 641 | public function hasIndex($tableName, $columns) |
|
| 642 | { |
|
| 643 | if (is_string($columns)) { |
|
| 644 | $columns = [$columns]; // str to array |
|
| 645 | } |
|
| 646 | ||
| 647 | $columns = array_map('strtolower', $columns); |
|
| 648 | $indexes = $this->getIndexes($tableName); |
|
| 649 | ||
| 650 | foreach ($indexes as $index) { |
|
| 651 | $a = array_diff($columns, $index['columns']); |
|
| 652 | if (empty($a)) { |
|
| 653 | return true; |
|
| 654 | } |
|
| 655 | } |
|
| 656 | ||
| 657 | return false; |
|
| 658 | } |
|
| 659 | ||
| 660 | /** |
|
| 661 | * {@inheritdoc} |
|