Skip to content

Commit 6089d00

Browse files
author
Bill Harding
committed
Rename withoutScopes and withoutAllScopes
1 parent 1f524a6 commit 6089d00

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

src/CacheKey.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@ class CacheKey
1616
protected $macroKey;
1717
protected $model;
1818
protected $query;
19-
protected $withoutScopes = [];
20-
protected $withoutAllScopes = false;
19+
protected $withoutGlobalScopes = [];
20+
protected $withoutAllGlobalScopes = false;
2121

2222
public function __construct(
2323
array $eagerLoad,
2424
$model,
2525
$query,
2626
$macroKey,
27-
array $withoutScopes,
28-
$withoutAllScopes
27+
array $withoutGlobalScopes,
28+
$withoutAllGlobalScopes
2929
) {
3030
$this->eagerLoad = $eagerLoad;
3131
$this->macroKey = $macroKey;
3232
$this->model = $model;
3333
$this->query = $query;
34-
$this->withoutScopes = $withoutScopes;
35-
$this->withoutAllScopes = $withoutAllScopes;
34+
$this->withoutGlobalScopes = $withoutGlobalScopes;
35+
$this->withoutAllGlobalScopes = $withoutAllGlobalScopes;
3636
}
3737

3838
public function make(
@@ -63,12 +63,12 @@ protected function getBindingsSlug() : string
6363
return '';
6464
}
6565

66-
if ($this->withoutAllScopes) {
66+
if ($this->withoutAllGlobalScopes) {
6767
return Arr::query($this->model->query()->withoutGlobalScopes()->getBindings());
6868
}
6969

70-
if (count($this->withoutScopes) > 0) {
71-
return Arr::query($this->model->query()->withoutGlobalScopes($this->withoutScopes)->getBindings());
70+
if (count($this->withoutGlobalScopes) > 0) {
71+
return Arr::query($this->model->query()->withoutGlobalScopes($this->withoutGlobalScopes)->getBindings());
7272
}
7373

7474
return Arr::query($this->model->query()->getBindings());

src/Traits/BuilderCaching.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ public function truncate()
2424

2525
public function withoutGlobalScope($scope)
2626
{
27-
array_push($this->withoutScopes, $scope);
27+
array_push($this->withoutGlobalScopes, $scope);
2828

2929
return parent::withoutGlobalScope($scope);
3030
}
3131

3232
public function withoutGlobalScopes(array $scopes = null)
3333
{
3434
if ($scopes != null) {
35-
$this->withoutScopes = $scopes;
35+
$this->withoutGlobalScopes = $scopes;
3636
}
3737

3838
if ($scopes == null || ($scopes != null && count($scopes) == 0)) {
39-
$this->withoutAllScopes = true;
39+
$this->withoutAllGlobalScopes = true;
4040
}
4141

4242
return parent::withoutGlobalScopes($scopes);

src/Traits/Caching.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ trait Caching
1616
protected $isCachable = true;
1717
protected $scopesAreApplied = false;
1818
protected $macroKey = "";
19-
protected $withoutScopes = [];
20-
protected $withoutAllScopes = false;
19+
protected $withoutGlobalScopes = [];
20+
protected $withoutAllGlobalScopes = false;
2121

2222
public function __call($method, $parameters)
2323
{
@@ -47,13 +47,13 @@ protected function applyScopesToInstance()
4747
{
4848
if (! property_exists($this, "scopes")
4949
|| $this->scopesAreApplied
50-
|| $this->withoutAllScopes
50+
|| $this->withoutAllGlobalScopes
5151
) {
5252
return;
5353
}
5454

5555
foreach ($this->scopes as $identifier => $scope) {
56-
if (! isset($this->scopes[$identifier]) || isset($this->withoutScopes[$identifier])) {
56+
if (! isset($this->scopes[$identifier]) || isset($this->withoutGlobalScopes[$identifier])) {
5757
continue;
5858
}
5959

@@ -169,7 +169,7 @@ protected function makeCacheKey(
169169
$query = $this->query->getQuery();
170170
}
171171

172-
return (new CacheKey($eagerLoad, $model, $query, $this->macroKey, $this->withoutScopes, $this->withoutAllScopes))
172+
return (new CacheKey($eagerLoad, $model, $query, $this->macroKey, $this->withoutGlobalScopes, $this->withoutAllGlobalScopes))
173173
->make($columns, $idColumn, $keyDifferentiator);
174174
}
175175

0 commit comments

Comments
 (0)