| 506 | | if (method_exists($item, $methodName) && is_object($item->$methodName())) |
|---|
| 507 | | { |
|---|
| 508 | | // categories as an object |
|---|
| 509 | | $categories = $item->$methodName(); |
|---|
| 510 | | if (is_array($categories)) |
|---|
| 511 | | { |
|---|
| 512 | | $cats = array(); |
|---|
| 513 | | foreach ($categories as $category) |
|---|
| 514 | | { |
|---|
| 515 | | $cats[] = (string) $category; |
|---|
| 516 | | } |
|---|
| 517 | | |
|---|
| 518 | | return $cats; |
|---|
| 519 | | } |
|---|
| | 506 | if (method_exists($item, $methodName) && is_array($item->$methodName())) |
|---|
| | 507 | { |
|---|
| | 508 | $cats = array(); |
|---|
| | 509 | foreach ($item->$methodName() as $category) |
|---|
| | 510 | { |
|---|
| | 511 | $cats[] = (string) $category; |
|---|
| | 512 | } |
|---|
| | 513 | |
|---|
| | 514 | return $cats; |
|---|