Conditions | 5 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 0 |
1 | <?php |
||
34 | $fields->removeByName([ |
||
35 | 'Name', |
||
36 | 'Title', |
||
37 | //'Products__ID', |
||
38 | ]); |
||
39 | } |
||
40 | |||
41 | public function updateCollectionItems(&$collection, &$searchCriteria) |
||
42 | { |
||
43 | $class = $this->owner->data()->ManagedClass; |
||
44 | |||
45 | if (isset($searchCriteria['CategoryID']) && $searchCriteria['CategoryID'] != '') { |
||
46 | $category = CatalogCategory::get()->byID($searchCriteria['CategoryID']); |
||
47 | $products = $category->Products(); |
||
48 | $docs = new ArrayList(); |
||
49 | |||
50 | foreach($products as $product) { |
||
51 | $records = $class::get()->filter(['Products.ID' => $product->ID]); |
||
52 | foreach ($records as $record) { |
||
53 | $docs->push($record); |
||
60 | } |