| @@ 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} |
|
| @@ 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} |
|
| @@ 642-659 (lines=18) @@ | ||
| 639 | /** |
|
| 640 | * {@inheritdoc} |
|
| 641 | */ |
|
| 642 | public function hasIndex($tableName, $columns) |
|
| 643 | { |
|
| 644 | if (is_string($columns)) { |
|
| 645 | $columns = [$columns]; // str to array |
|
| 646 | } |
|
| 647 | ||
| 648 | $columns = array_map('strtolower', $columns); |
|
| 649 | $indexes = $this->getIndexes($tableName); |
|
| 650 | ||
| 651 | foreach ($indexes as $index) { |
|
| 652 | $a = array_diff($columns, $index['columns']); |
|
| 653 | if (empty($a)) { |
|
| 654 | return true; |
|
| 655 | } |
|
| 656 | } |
|
| 657 | ||
| 658 | return false; |
|
| 659 | } |
|
| 660 | ||
| 661 | /** |
|
| 662 | * {@inheritdoc} |
|
| @@ 711-729 (lines=19) @@ | ||
| 708 | /** |
|
| 709 | * {@inheritdoc} |
|
| 710 | */ |
|
| 711 | public function hasIndex($tableName, $columns) |
|
| 712 | { |
|
| 713 | if (is_string($columns)) { |
|
| 714 | $columns = [$columns]; // str to array |
|
| 715 | } |
|
| 716 | ||
| 717 | $columns = array_map('strtolower', $columns); |
|
| 718 | $indexes = $this->getIndexes($tableName); |
|
| 719 | ||
| 720 | foreach ($indexes as $index) { |
|
| 721 | $a = array_diff($columns, $index['columns']); |
|
| 722 | ||
| 723 | if (empty($a)) { |
|
| 724 | return true; |
|
| 725 | } |
|
| 726 | } |
|
| 727 | ||
| 728 | return false; |
|
| 729 | } |
|
| 730 | ||
| 731 | /** |
|
| 732 | * {@inheritdoc} |
|