| Conditions | 5 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 51 | public function updateCollectionItems(&$collection, &$searchCriteria) |
||
| 52 | { |
||
| 53 | $class = $this->owner->data()->ManagedClass; |
||
| 54 | |||
| 55 | if (isset($searchCriteria['CategoryID']) && $searchCriteria['CategoryID'] != '') { |
||
| 56 | $category = CatalogCategory::get()->byID($searchCriteria['CategoryID']); |
||
| 57 | $products = $category->Products(); |
||
| 58 | $docs = new ArrayList(); |
||
| 59 | |||
| 60 | foreach ($products as $product) { |
||
| 61 | $records = $class::get()->filter(['Products.ID' => $product->ID]); |
||
| 62 | foreach ($records as $record) { |
||
| 63 | $docs->push($record); |
||
| 64 | } |
||
| 65 | } |
||
| 66 | |||
| 67 | $collection = $docs; |
||
| 68 | } |
||
| 71 |