| @@ 645-651 (lines=7) @@ | ||
| 642 | } elseif ($typecast === 'slug') { |
|
| 643 | $categories = array_map('trim', $categories); |
|
| 644 | $categoryIds = []; |
|
| 645 | foreach ($categories as $part) { |
|
| 646 | $cat = Category::findBySlug($part, 1, -1); |
|
| 647 | if (is_object($cat)) { |
|
| 648 | $categoryIds[] = $cat->id; |
|
| 649 | } |
|
| 650 | unset($cat); |
|
| 651 | } |
|
| 652 | $categories = array_map('intval', $categoryIds); |
|
| 653 | } elseif ($typecast === 'name') { |
|
| 654 | $categories = array_map('trim', $categories); |
|
| @@ 656-662 (lines=7) @@ | ||
| 653 | } elseif ($typecast === 'name') { |
|
| 654 | $categories = array_map('trim', $categories); |
|
| 655 | $categoryIds = []; |
|
| 656 | foreach ($categories as $part) { |
|
| 657 | $cat = Category::findByName($part, 1, -1); |
|
| 658 | if (is_object($cat)) { |
|
| 659 | $categoryIds[] = $cat->id; |
|
| 660 | } |
|
| 661 | unset($cat); |
|
| 662 | } |
|
| 663 | $categories = array_map('intval', $categoryIds); |
|
| 664 | } else { |
|
| 665 | // that's unusual behavior |
|