Completed
Push — master ( 568d87...b0a8a2 )
by Fabian
28s queued 11s
created

User::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Firegento\DevDashboard\Plugin\Model;
5
6
class User
7
{
8
    protected $_configRepository;
9
10
    public function __construct(\Firegento\DevDashboard\Model\ConfigRepository $configRepository)
11
    {
12
        $this->_configRepository = $configRepository;
13
    }
14
15
    public function afterLoad(\Magento\User\Model\User $subject, $result)
16
    {
17
        $userConfig = $this->_configRepository->getByUserId($subject->getId());
18
        $result->setData('use_devdashboard', $userConfig->getData('use_devdashboard'));
19
        return $result;
20
    }
21
}
22