1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Firegento\DevDashboard\Model; |
4
|
|
|
|
5
|
|
|
use Firegento\DevDashboard\Api\Data\ConfigInterface; |
6
|
|
|
use Firegento\DevDashboard\Model\ConfigFactory; |
|
|
|
|
7
|
|
|
use Firegento\DevDashboard\Model\ResourceModel\Config\CollectionFactory; |
|
|
|
|
8
|
|
|
|
9
|
|
|
use Magento\Framework\Exception\CouldNotSaveException; |
10
|
|
|
use Magento\Framework\Api\SearchResultsInterfaceFactory; |
|
|
|
|
11
|
|
|
|
12
|
|
|
class ConfigRepository implements \Firegento\DevDashboard\Api\ConfigRepositoryInterface |
13
|
|
|
{ |
14
|
|
|
protected $objectFactory; |
15
|
|
|
protected $collectionFactory; |
16
|
|
|
|
17
|
|
|
public function __construct( |
18
|
|
|
ConfigFactory $objectFactory, |
19
|
|
|
CollectionFactory $collectionFactory, |
20
|
|
|
SearchResultsInterfaceFactory $searchResultsFactory |
21
|
|
|
) |
22
|
|
|
{ |
23
|
|
|
$this->objectFactory = $objectFactory; |
24
|
|
|
$this->collectionFactory = $collectionFactory; |
25
|
|
|
$this->searchResultsFactory = $searchResultsFactory; |
|
|
|
|
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @param ConfigInterface $object |
30
|
|
|
* @return ConfigInterface |
31
|
|
|
* @throws CouldNotSaveException |
32
|
|
|
*/ |
33
|
|
|
public function save(ConfigInterface $object) |
34
|
|
|
{ |
35
|
|
|
try { |
36
|
|
|
$object->save(); |
|
|
|
|
37
|
|
|
} catch (\Exception $e) { |
38
|
|
|
throw new CouldNotSaveException(__($e->getMessage())); |
|
|
|
|
39
|
|
|
} |
40
|
|
|
return $object; |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @param int $user_id |
45
|
|
|
* @return Config |
46
|
|
|
*/ |
47
|
|
|
public function getByUserId($user_id) |
48
|
|
|
{ |
49
|
|
|
/** @var \Firegento\DevDashboard\Model\Config $object */ |
50
|
|
|
$object = $this->objectFactory->create(); |
51
|
|
|
$object->load($user_id, 'user_id'); |
|
|
|
|
52
|
|
|
return $object; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
} |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths