| @@ 285-294 (lines=10) @@ | ||
| 282 | * @param Product $model |
|
| 283 | * @return string |
|
| 284 | */ |
|
| 285 | static private function getCategories(Product $model) |
|
| 286 | { |
|
| 287 | $categories = []; |
|
| 288 | $category = $model->category; |
|
| 289 | while (null !== $category) { |
|
| 290 | array_unshift($categories, $category->name); |
|
| 291 | $category = $category->parent; |
|
| 292 | } |
|
| 293 | return implode('/', array_slice($categories, 0, 5)); |
|
| 294 | } |
|
| 295 | } |
|
| 296 | ||
| @@ 291-300 (lines=10) @@ | ||
| 288 | * @param Product $model |
|
| 289 | * @return string |
|
| 290 | */ |
|
| 291 | static private function getCategories(Product $model) |
|
| 292 | { |
|
| 293 | $categories = []; |
|
| 294 | $category = $model->category; |
|
| 295 | while (null !== $category) { |
|
| 296 | array_unshift($categories, $category->name); |
|
| 297 | $category = $category->parent; |
|
| 298 | } |
|
| 299 | return implode('/', array_slice($categories, 0, 5)); |
|
| 300 | } |
|
| 301 | } |
|
| 302 | ||