Skip to content

Commit a77f8c6

Browse files
AC-1553: Manage admin action logs
* Logging level changes
1 parent a8543fe commit a77f8c6

File tree

1 file changed

+15
-12
lines changed
  • app/code/Magento/Customer/Model/ResourceModel/Online/Grid

1 file changed

+15
-12
lines changed

app/code/Magento/Customer/Model/ResourceModel/Online/Grid/Collection.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
*/
66
namespace Magento\Customer\Model\ResourceModel\Online\Grid;
77

8-
use Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult;
98
use Magento\Customer\Model\Visitor;
10-
use Magento\Framework\Api;
11-
use Magento\Framework\Event\ManagerInterface as EventManager;
129
use Magento\Framework\Data\Collection\Db\FetchStrategyInterface as FetchStrategy;
1310
use Magento\Framework\Data\Collection\EntityFactoryInterface as EntityFactory;
11+
use Magento\Framework\Event\ManagerInterface as EventManager;
12+
use Magento\Framework\Exception\LocalizedException;
13+
use Magento\Framework\Stdlib\DateTime\DateTime;
14+
use Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult;
1415
use Psr\Log\LoggerInterface as Logger;
1516

1617
/**
@@ -23,17 +24,17 @@ class Collection extends SearchResult
2324
/**
2425
* Value of seconds in one minute
2526
*/
26-
const SECONDS_IN_MINUTE = 60;
27+
public const SECONDS_IN_MINUTE = 60;
2728

2829
/**
29-
* @var \Magento\Framework\Stdlib\DateTime\DateTime
30+
* @var DateTime
3031
*/
31-
protected $date;
32+
protected DateTime $date;
3233

3334
/**
3435
* @var Visitor
3536
*/
36-
protected $visitorModel;
37+
protected Visitor $visitorModel;
3738

3839
/**
3940
* @param EntityFactory $entityFactory
@@ -43,7 +44,8 @@ class Collection extends SearchResult
4344
* @param string $mainTable
4445
* @param string $resourceModel
4546
* @param Visitor $visitorModel
46-
* @param \Magento\Framework\Stdlib\DateTime\DateTime $date
47+
* @param DateTime $date
48+
* @throws LocalizedException
4749
*/
4850
public function __construct(
4951
EntityFactory $entityFactory,
@@ -53,7 +55,7 @@ public function __construct(
5355
$mainTable,
5456
$resourceModel,
5557
Visitor $visitorModel,
56-
\Magento\Framework\Stdlib\DateTime\DateTime $date
58+
DateTime $date
5759
) {
5860
$this->date = $date;
5961
$this->visitorModel = $visitorModel;
@@ -65,8 +67,9 @@ public function __construct(
6567
*
6668
* @return $this
6769
*/
68-
protected function _initSelect()
70+
protected function _initSelect(): Collection
6971
{
72+
$this->addFilterToMap('customer_id', 'main_table.customer_id');
7073
parent::_initSelect();
7174
$connection = $this->getConnection();
7275
$lastDate = $this->date->gmtTimestamp() - $this->visitorModel->getOnlineInterval() * self::SECONDS_IN_MINUTE;
@@ -92,9 +95,9 @@ protected function _initSelect()
9295
*
9396
* @param string|array $field
9497
* @param string|int|array|null $condition
95-
* @return \Magento\Cms\Model\ResourceModel\Block\Collection
98+
* @return Collection
9699
*/
97-
public function addFieldToFilter($field, $condition = null)
100+
public function addFieldToFilter($field, $condition = null): Collection
98101
{
99102
if ($field == 'visitor_type') {
100103
$field = 'customer_id';

0 commit comments

Comments
 (0)