Produced by Araxis Merge on 2023-03-13 03:00:43 +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.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | Porto v4.0.4/Porto Theme/app/code/Mageplaza/LayeredNavigation/Model/Layer/Filter | CategoryItem.php | 2022-09-07 03:46:05 +0000 |
| 2 | Porto v4.0.5/Porto Theme/app/code/Mageplaza/LayeredNavigation/Model/Layer/Filter | CategoryItem.php | 2022-12-08 01:34:28 +0000 |
| Description | Between Files 1 and 2 | |
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 1 | 280 |
| Changed | 0 | 0 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | Consecutive whitespace is treated as a single space |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
| Active line-pairing rules |
No regular expressions were active.
| 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\Layer\Filter; | 22 | namespace Mageplaza\LayeredNavigation\Model\Layer\Filter; | |||
| 23 | 23 | |||||
| 24 | /** | 24 | /** | |||
| 25 | * Class CategoryItem | 25 | * Class CategoryItem | |||
| 26 | * @package Mageplaza\LayeredNavigation\Model\Layer\Filter | 26 | * @package Mageplaza\LayeredNavigation\Model\Layer\Filter | |||
| 27 | */ | 27 | */ | |||
| 28 | class CategoryItem extends \Magento\Framework\DataObject implements \Countable | 28 | class CategoryItem extends \Magento\Framework\DataObject implements \Countable | |||
| 29 | { | 29 | { | |||
| 30 | /** | 30 | /** | |||
| 31 | * @var array | 31 | * @var array | |||
| 32 | */ | 32 | */ | |||
| 33 | protected $_items = []; | 33 | protected $_items = []; | |||
| 34 | 34 | |||||
| 35 | /** | 35 | /** | |||
| 36 | * @var int | 36 | * @var int | |||
| 37 | */ | 37 | */ | |||
| 38 | protected $_count = 0; | 38 | protected $_count = 0; | |||
| 39 | 39 | |||||
| 40 | protected $startPath = ''; | 40 | protected $startPath = ''; | |||
| 41 | 41 | |||||
| 42 | /** | 42 | /** | |||
| 43 | * @param null $id | 43 | * @param null $id | |||
| 44 | * | 44 | * | |||
| 45 | * @return array|mixed | 45 | * @return array|mixed | |||
| 46 | */ | 46 | */ | |||
| 47 | public function getItems($id = null) | 47 | public function getItems($id = null) | |||
| 48 | { | 48 | { | |||
| 49 | if (!$id) { | 49 | if (!$id) { | |||
| 50 | $id = $this->startPath; | 50 | $id = $this->startPath; | |||
| 51 | } | 51 | } | |||
| 52 | 52 | |||||
| 53 | return isset($this->_items[$id]) ? $this->_items[$id] : []; | 53 | return isset($this->_items[$id]) ? $this->_items[$id] : []; | |||
| 54 | } | 54 | } | |||
| 55 | 55 | |||||
| 56 | /** | 56 | /** | |||
| 57 | * @return array | 57 | * @return array | |||
| 58 | */ | 58 | */ | |||
| 59 | public function getAllItems() | 59 | public function getAllItems() | |||
| 60 | { | 60 | { | |||
| 61 | $allItems = []; | 61 | $allItems = []; | |||
| 62 | foreach ($this->_items as $items) { | 62 | foreach ($this->_items as $items) { | |||
| 63 | // @codingStandardsIgnoreLine | 63 | // @codingStandardsIgnoreLine | |||
| 64 | $allItems = array_merge($allItems, $items); | 64 | $allItems = array_merge($allItems, $items); | |||
| 65 | } | 65 | } | |||
| 66 | 66 | |||||
| 67 | return $allItems; | 67 | return $allItems; | |||
| 68 | } | 68 | } | |||
| 69 | 69 | |||||
| 70 | /** | 70 | /** | |||
| 71 | * @param $parentId | 71 | * @param $parentId | |||
| 72 | * @param $item | 72 | * @param $item | |||
| 73 | * | 73 | * | |||
| 74 | * @return $this | 74 | * @return $this | |||
| 75 | */ | 75 | */ | |||
| 76 | public function addItem($parentId, $item) | 76 | public function addItem($parentId, $item) | |||
| 77 | { | 77 | { | |||
| 78 | $this->_items[$parentId][] = $item; | 78 | $this->_items[$parentId][] = $item; | |||
| 79 | 79 | |||||
| 80 | return $this; | 80 | return $this; | |||
| 81 | } | 81 | } | |||
| 82 | 82 | |||||
| 83 | /** | 83 | /** | |||
| 84 | * @param $startPath | 84 | * @param $startPath | |||
| 85 | * | 85 | * | |||
| 86 | * @return $this | 86 | * @return $this | |||
| 87 | */ | 87 | */ | |||
| 88 | public function setStartPath($startPath) | 88 | public function setStartPath($startPath) | |||
| 89 | { | 89 | { | |||
| 90 | $this->startPath = $startPath; | 90 | $this->startPath = $startPath; | |||
| 91 | 91 | |||||
| 92 | return $this; | 92 | return $this; | |||
| 93 | } | 93 | } | |||
| 94 | 94 | |||||
| 95 | /** | 95 | /** | |||
| 96 | * @return string | 96 | * @return string | |||
| 97 | */ | 97 | */ | |||
| 98 | public function getStartPath() | 98 | public function getStartPath() | |||
| 99 | { | 99 | { | |||
| 100 | return $this->startPath; | 100 | return $this->startPath; | |||
| 101 | } | 101 | } | |||
| 102 | 102 | |||||
| 103 | /** | 103 | /** | |||
| 104 | * @return int | 104 | * @return int | |||
| 105 | */ | 105 | */ | |||
| 106 | public function getCount() | 106 | public function getCount() | |||
| 107 | { | 107 | { | |||
| 108 | return $this->_count; | 108 | return $this->_count; | |||
| 109 | } | 109 | } | |||
| 110 | 110 | |||||
| 111 | /** | 111 | /** | |||
| 112 | * @param $count | 112 | * @param $count | |||
| 113 | * | 113 | * | |||
| 114 | * @return $this | 114 | * @return $this | |||
| 115 | */ | 115 | */ | |||
| 116 | public function setCount($count) | 116 | public function setCount($count) | |||
| 117 | { | 117 | { | |||
| 118 | $this->_count = $count; | 118 | $this->_count = $count; | |||
| 119 | 119 | |||||
| 120 | return $this; | 120 | return $this; | |||
| 121 | } | 121 | } | |||
| 122 | 122 | |||||
| 123 | /** | 123 | /** | |||
| 124 | * @param $parentId | 124 | * @param $parentId | |||
| 125 | * | 125 | * | |||
| 126 | * @return bool | 126 | * @return bool | |||
| 127 | */ | 127 | */ | |||
| 128 | public function hasChildrenData($parentId) | 128 | public function hasChildrenData($parentId) | |||
| 129 | { | 129 | { | |||
| 130 | return isset($this->_items[$parentId]) && count($this->_items[$parentId]); | 130 | return isset($this->_items[$parentId]) && count($this->_items[$parentId]); | |||
| 131 | } | 131 | } | |||
| 132 | 132 | |||||
| 133 | /** | 133 | /** | |||
| 134 | * @return int | 134 | * @return int | |||
| 135 | */ | 135 | */ | |||
| 136 | public function count(): int | 136 | public function count(): int | |||
| 137 | { | 137 | { | |||
| 138 | return count($this->_items); | 138 | return count($this->_items); | |||
| 139 | } | 139 | } | |||
| 140 | } | 140 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993–2019 Araxis Ltd (www.araxis.com). All rights reserved.