1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Phpsa\Datastore\Repositories; |
4
|
|
|
|
5
|
|
|
|
6
|
|
|
use App\Repositories\BaseRepository; |
|
|
|
|
7
|
|
|
use Phpsa\Datastore\Models\Datastore as DatastoreModel; |
8
|
|
|
use Illuminate\Database\Eloquent\Collection; |
9
|
|
|
use Phpsa\Datastore\Datastore; |
10
|
|
|
use Phpsa\Datastore\Models\DatastoreDatastore; |
11
|
|
|
use Phpsa\Datastore\Repositories\DatastoreDatastoreRepository; |
12
|
|
|
/** |
13
|
|
|
* Class PermissionRepository. |
14
|
|
|
*/ |
15
|
|
|
class DatastoreRepository extends BaseRepository |
16
|
|
|
{ |
17
|
|
|
/** |
18
|
|
|
* @return string |
19
|
|
|
*/ |
20
|
|
|
public function model() |
21
|
|
|
{ |
22
|
|
|
return DatastoreModel::class; |
23
|
|
|
} |
24
|
|
|
|
25
|
|
|
public function paginateAssets($assetData, $limit = 25, $pageName = 'page', $page = null){ |
26
|
|
|
$this->where('type', $assetData['class']); |
27
|
|
|
return $this->paginate($limit, ['*'], $pageName, $page); |
28
|
|
|
|
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @param int $limit |
34
|
|
|
* @param array $columns |
35
|
|
|
* @param string $pageName |
36
|
|
|
* @param null $page |
|
|
|
|
37
|
|
|
* |
38
|
|
|
* @return \Illuminate\Contracts\Pagination\LengthAwarePaginator |
39
|
|
|
*/ |
40
|
|
|
public function paginate($limit = 25, array $columns = ['*'], $pageName = 'page', $page = null) |
41
|
|
|
{ |
42
|
|
|
$this->newQuery()->eagerLoad()->setClauses()->setScopes(); |
43
|
|
|
|
44
|
|
|
$models = $this->query->paginate($limit, $columns, $pageName, $page); |
45
|
|
|
|
46
|
|
|
$this->unsetClauses(); |
47
|
|
|
|
48
|
|
|
return $models; |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
|
52
|
|
|
public function paginateAccepted($datastore_id, $status = NULL, $limit = 25, $pageName = 'page', $page = null){ |
53
|
|
|
$ds2 = new DatastoreDatastoreRepository(); |
54
|
|
|
return $ds2->paginateAccepted($datastore_id, $status, $limit, $pageName, $page); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
public function paginateSearchProp($property, $property_value, $parent_type, $parent_status = NULL, $limit = 25, $pageName = 'page', $page = null){ |
58
|
|
|
|
59
|
|
|
if($parent_status){ |
60
|
|
|
$this->where('status', $published_status); |
|
|
|
|
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
$this->newQuery()->eagerLoad()->setClauses()->setScopes(); |
64
|
|
|
|
65
|
|
|
$this->with('properties')->whereHas('properties', function($query) use ($property, $property_value) { |
66
|
|
|
$query->where('value', $property_value); |
67
|
|
|
$query->where('key', $property); |
68
|
|
|
}); |
69
|
|
|
|
70
|
|
|
return $this->paginate($limit, ['*'], $pageName, $page); |
71
|
|
|
|
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
//DatastoreDatastoreRepository |
75
|
|
|
|
76
|
|
|
} |
77
|
|
|
|
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