Skip to content

Commit 34d645b

Browse files
author
Corey McCormick
committed
Update trial to use getters
1 parent f88c29e commit 34d645b

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/Cacheable.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ trait Cacheable
1111
*/
1212
public function getCacheStore()
1313
{
14-
if (property_exists($this, 'cacheStore')) return $this->cacheStore;
14+
if (isset($this->cacheStore)) return $this->cacheStore;
1515

1616
return null;
1717
}
@@ -24,7 +24,7 @@ public function getCacheStore()
2424
*/
2525
public function getCacheBusting()
2626
{
27-
if (property_exists($this, 'cacheBusting')) return $this->cacheBusting;
27+
if (isset($this->cacheBusting)) return $this->cacheBusting;
2828

2929
return false;
3030
}
@@ -36,7 +36,7 @@ public function getCacheBusting()
3636
*/
3737
public function getCacheLength()
3838
{
39-
if (property_exists($this, 'cacheLength')) return $this->cacheLength;
39+
if (isset($this->cacheLength)) return $this->cacheLength;
4040

4141
return 30;
4242
}
@@ -62,7 +62,7 @@ protected function newBaseQueryBuilder()
6262
*/
6363
protected function queryCache()
6464
{
65-
return new QueryCache($this->cacheStore, $this->getCacheLength());
65+
return new QueryCache($this->getCacheStore(), $this->getCacheLength());
6666
}
6767

6868
/**
@@ -73,7 +73,7 @@ protected function queryCache()
7373
*/
7474
public function finishSave(array $options)
7575
{
76-
if ($this->cacheBusting) {
76+
if ($this->getCacheBusting()) {
7777
$this->queryCache()->flush($this->getTable());
7878
}
7979

@@ -87,7 +87,7 @@ public function finishSave(array $options)
8787
*/
8888
public function delete()
8989
{
90-
if ($this->cacheBusting) {
90+
if ($this->getCacheBusting()) {
9191
$this->queryCache()->flush($this->getTable());
9292
}
9393

@@ -125,6 +125,6 @@ public function dontBust()
125125
*/
126126
public function isBusting()
127127
{
128-
return $this->cacheBusting;
128+
return $this->getCacheBusting();
129129
}
130130
}

0 commit comments

Comments
 (0)