| @@ 656-662 (lines=7) @@ | ||
| 653 | } elseif ($typecast === 'slug') { |
|
| 654 | $categories = array_map('trim', $categories); |
|
| 655 | $categoryIds = []; |
|
| 656 | foreach ($categories as $part) { |
|
| 657 | $cat = Category::findBySlug($part, 1, -1); |
|
| 658 | if (is_object($cat)) { |
|
| 659 | $categoryIds[] = $cat->id; |
|
| 660 | } |
|
| 661 | unset($cat); |
|
| 662 | } |
|
| 663 | $categories = array_map('intval', $categoryIds); |
|
| 664 | } elseif ($typecast === 'name') { |
|
| 665 | $categories = array_map('trim', $categories); |
|
| @@ 667-673 (lines=7) @@ | ||
| 664 | } elseif ($typecast === 'name') { |
|
| 665 | $categories = array_map('trim', $categories); |
|
| 666 | $categoryIds = []; |
|
| 667 | foreach ($categories as $part) { |
|
| 668 | $cat = Category::findByName($part, 1, -1); |
|
| 669 | if (is_object($cat)) { |
|
| 670 | $categoryIds[] = $cat->id; |
|
| 671 | } |
|
| 672 | unset($cat); |
|
| 673 | } |
|
| 674 | $categories = array_map('intval', $categoryIds); |
|
| 675 | } else { |
|
| 676 | // that's unusual behavior |
|