30. Araxis Merge File Comparison Report

Produced by Araxis Merge on 2023-07-12 04:42:37 +0000. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

30.1 Files compared

#LocationFileLast Modified
1Porto v4.0.5/Theme Files/Porto Theme/app/code/Mageplaza/LayeredNavigation/Model/SearchSearchCriteriaBuilder.php2022-12-08 01:34:28 +0000
2Porto v4.0.6/Theme Files/Porto Theme/app/code/Mageplaza/LayeredNavigation/Model/SearchSearchCriteriaBuilder.php2023-05-05 02:25:46 +0000

30.2 Comparison summary

DescriptionBetween
Files 1 and 2
Text BlocksLines
Unchanged1236
Changed00
Inserted00
Removed00

30.3 Comparison options

WhitespaceConsecutive whitespace is treated as a single space
Character caseDifferences in character case are significant
Line endingsDifferences in line endings (CR and LF characters) are ignored
CR/LF charactersNot shown in the comparison detail
Active line-pairing rules

30.4 Active regular expressions

No regular expressions were active.

30.5 Comparison detail

1 <?php 1 <?php
2 /** 2 /**
3  * Mageplaza 3  * Mageplaza
4  * 4  *
5  * NOTICE OF LICENSE 5  * NOTICE OF LICENSE
6  * 6  *
7  * This source file is subject to the Mageplaza.com license that is 7  * This source file is subject to the Mageplaza.com license that is
8  * available through the world-wide-web at this URL: 8  * available through the world-wide-web at this URL:
9  * https://www.mageplaza.com/LICENSE.txt 9  * https://www.mageplaza.com/LICENSE.txt
10  * 10  *
11  * DISCLAIMER 11  * DISCLAIMER
12  * 12  *
13  * Do not edit or add to this file if you wish to upgrade this extension to newer 13  * Do not edit or add to this file if you wish to upgrade this extension to newer
14  * version in the future. 14  * version in the future.
15  * 15  *
16  * @category    Mageplaza 16  * @category    Mageplaza
17  * @package     Mageplaza_LayeredNavigation 17  * @package     Mageplaza_LayeredNavigation
18  * @copyright   Copyright (c) Mageplaza (https://www.mageplaza.com/) 18  * @copyright   Copyright (c) Mageplaza (https://www.mageplaza.com/)
19  * @license     https://www.mageplaza.com/LICENSE.txt 19  * @license     https://www.mageplaza.com/LICENSE.txt
20  */ 20  */
21  21 
22 namespace Mageplaza\LayeredNavigation\Model\Search; 22 namespace Mageplaza\LayeredNavigation\Model\Search;
23  23 
24 use Magento\Framework\Api\Search\SearchCriteria; 24 use Magento\Framework\Api\Search\SearchCriteria;
25 use Magento\Framework\Api\Search\SearchCriteriaBuilder as SourceSearchCriteriaBuilder; 25 use Magento\Framework\Api\Search\SearchCriteriaBuilder as SourceSearchCriteriaBuilder;
26  26 
27 /** 27 /**
28  * Builder for SearchCriteria Service Data Object 28  * Builder for SearchCriteria Service Data Object
29  */ 29  */
30 class SearchCriteriaBuilder extends SourceSearchCriteriaBuilder 30 class SearchCriteriaBuilder extends SourceSearchCriteriaBuilder
31 { 31 {
32     /** 32     /**
33      * @var array 33      * @var array
34      */ 34      */
35     private $filters = []; 35     private $filters = [];
36  36 
37     /** 37     /**
38      * Builds the SearchCriteria Data Object 38      * Builds the SearchCriteria Data Object
39      * 39      *
40      * @return SearchCriteria 40      * @return SearchCriteria
41      */ 41      */
42     public function create() 42     public function create()
43     { 43     {
44         foreach ($this->filters as $filter) { 44         foreach ($this->filters as $filter) {
45             $this->data[SearchCriteria::FILTER_GROUPS][] = $this->filterGroupBuilder->setFilters([]) 45             $this->data[SearchCriteria::FILTER_GROUPS][] = $this->filterGroupBuilder->setFilters([])
46                 ->addFilter($filter) 46                 ->addFilter($filter)
47                 ->create(); 47                 ->create();
48         } 48         }
49  49 
50         return parent::create(); 50         return parent::create();
51     } 51     }
52  52 
53     /** 53     /**
54      * Create a filter group based on the filter array provided and add to the filter groups 54      * Create a filter group based on the filter array provided and add to the filter groups
55      * 55      *
56      * @param \Magento\Framework\Api\Filter $filter 56      * @param \Magento\Framework\Api\Filter $filter
57      * @return \Magento\Framework\Api\Search\SearchCriteriaBuilder 57      * @return \Magento\Framework\Api\Search\SearchCriteriaBuilder
58      */ 58      */
59     public function addFilter(\Magento\Framework\Api\Filter $filter) 59     public function addFilter(\Magento\Framework\Api\Filter $filter)
60     { 60     {
61         $this->filters[] = $filter; 61         $this->filters[] = $filter;
62         return $this; 62         return $this;
63     } 63     }
64  64 
65     /** 65     /**
66      * @param $attributeCode 66      * @param $attributeCode
67      * 67      *
68      * @return $this 68      * @return $this
69      */ 69      */
70     public function removeFilter($attributeCode) 70     public function removeFilter($attributeCode)
71     { 71     {
72         foreach ($this->filters as $key => $filter) { 72         foreach ($this->filters as $key => $filter) {
73             if ($filter->getField() == $attributeCode) { 73             if ($filter->getField() == $attributeCode) {
74                 unset($this->filters[$key]); 74                 unset($this->filters[$key]);
75                 break; 75                 break;
76             } 76             }
77         } 77         }
78  78 
79         return $this; 79         return $this;
80     } 80     }
81  81 
82     /** 82     /**
83      * @param $categoryIds 83      * @param $categoryIds
84      * 84      *
85      * @return $this 85      * @return $this
86      */ 86      */
87     public function setCategoryFilter($categoryIds) 87     public function setCategoryFilter($categoryIds)
88     { 88     {
89         foreach ($this->filters as $key => $filter) { 89         foreach ($this->filters as $key => $filter) {
90             if ($filter->getField() === 'category_ids') { 90             if ($filter->getField() === 'category_ids') {
91                 $filter->setValue($categoryIds); 91                 $filter->setValue($categoryIds);
92                 break; 92                 break;
93             } 93             }
94         } 94         }
95  95 
96         return $this; 96         return $this;
97     } 97     }
98  98 
99     /** 99     /**
100      * @return SearchCriteriaBuilder 100      * @return SearchCriteriaBuilder
101      */ 101      */
102     public function cloneObject() 102     public function cloneObject()
103     { 103     {
104         $cloneObject = clone $this; 104         $cloneObject = clone $this;
105  105 
106         return $cloneObject; 106         return $cloneObject;
107     } 107     }
108  108 
109     /** 109     /**
110      * Return the Data type class name 110      * Return the Data type class name
111      * 111      *
112      * @return string 112      * @return string
113      */ 113      */
114     protected function _getDataObjectType() 114     protected function _getDataObjectType()
115     { 115     {
116         return SearchCriteria::class; 116         return SearchCriteria::class;
117     } 117     }
118 } 118 }