5
5
*/
6
6
namespace Magento \Search \Model \ResourceModel \Query ;
7
7
8
+ use Magento \Framework \Data \Collection \Db \FetchStrategyInterface ;
9
+ use Magento \Framework \Data \Collection \EntityFactoryInterface ;
10
+ use Magento \Framework \DB \Adapter \AdapterInterface ;
11
+ use Magento \Framework \DB \Helper ;
12
+ use Magento \Framework \Event \ManagerInterface ;
13
+ use Magento \Framework \Model \ResourceModel \Db \AbstractDb ;
14
+ use Magento \Framework \Model \ResourceModel \Db \Collection \AbstractCollection ;
8
15
use Magento \Store \Model \Store ;
16
+ use Magento \Store \Model \StoreManagerInterface ;
17
+ use Psr \Log \LoggerInterface ;
9
18
10
19
/**
11
20
* Search query collection
12
21
*
13
22
* @api
14
23
* @since 100.0.2
24
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
15
25
*/
16
- class Collection extends \ Magento \ Framework \ Model \ ResourceModel \ Db \ Collection \ AbstractCollection
26
+ class Collection extends AbstractCollection
17
27
{
18
28
/**
19
29
* Store for filter
@@ -25,36 +35,38 @@ class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\Ab
25
35
/**
26
36
* Store manager
27
37
*
28
- * @var \Magento\Store\Model\ StoreManagerInterface
38
+ * @var StoreManagerInterface
29
39
*/
30
40
protected $ _storeManager ;
31
41
32
42
/**
33
43
* Search resource helper
34
44
*
35
- * @var \Magento\Framework\DB\ Helper
45
+ * @var Helper
36
46
*/
37
47
protected $ _resourceHelper ;
38
48
39
49
/**
40
- * @param \Magento\Framework\Data\Collection\EntityFactory $entityFactory
41
- * @param \Psr\Log\LoggerInterface $logger
42
- * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy
43
- * @param \Magento\Framework\Event\ManagerInterface $eventManager
44
- * @param \Magento\Store\Model\StoreManagerInterface $storeManager
45
- * @param \Magento\Framework\DB\Helper $resourceHelper
46
- * @param \Magento\Framework\DB\Adapter\AdapterInterface $connection
47
- * @param \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource
50
+ * Constructor
51
+ *
52
+ * @param EntityFactoryInterface $entityFactory
53
+ * @param LoggerInterface $logger
54
+ * @param FetchStrategyInterface $fetchStrategy
55
+ * @param ManagerInterface $eventManager
56
+ * @param StoreManagerInterface $storeManager
57
+ * @param Helper $resourceHelper
58
+ * @param AdapterInterface $connection
59
+ * @param AbstractDb $resource
48
60
*/
49
61
public function __construct (
50
- \ Magento \ Framework \ Data \ Collection \ EntityFactoryInterface $ entityFactory ,
51
- \ Psr \ Log \ LoggerInterface $ logger ,
52
- \ Magento \ Framework \ Data \ Collection \ Db \ FetchStrategyInterface $ fetchStrategy ,
53
- \ Magento \ Framework \ Event \ ManagerInterface $ eventManager ,
54
- \ Magento \ Store \ Model \ StoreManagerInterface $ storeManager ,
55
- \ Magento \ Framework \ DB \ Helper $ resourceHelper ,
56
- \ Magento \ Framework \ DB \ Adapter \ AdapterInterface $ connection = null ,
57
- \ Magento \ Framework \ Model \ ResourceModel \ Db \ AbstractDb $ resource = null
62
+ EntityFactoryInterface $ entityFactory ,
63
+ LoggerInterface $ logger ,
64
+ FetchStrategyInterface $ fetchStrategy ,
65
+ ManagerInterface $ eventManager ,
66
+ StoreManagerInterface $ storeManager ,
67
+ Helper $ resourceHelper ,
68
+ AdapterInterface $ connection = null ,
69
+ AbstractDb $ resource = null
58
70
) {
59
71
$ this ->_storeManager = $ storeManager ;
60
72
$ this ->_resourceHelper = $ resourceHelper ;
@@ -178,7 +190,7 @@ public function isTopSearchResult(string $term, int $storeId, int $maxCountCache
178
190
179
191
return $ this ->getSize () > 0 ;
180
192
}
181
-
193
+
182
194
/**
183
195
* Set Recent Queries Order
184
196
*
0 commit comments