Skip to content

Commit

Permalink
Merge pull request #447 from dmason30/master
Browse files Browse the repository at this point in the history
Add reset calls to CacheableRepository
  • Loading branch information
eullercdr authored Oct 24, 2017
2 parents 756862e + b82b42e commit b95fc26
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Prettus/Repository/Traits/CacheableRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ public function all($columns = ['*'])
return parent::all($columns);
});

$this->resetModel();
$this->resetScope();
return $value;
}

Expand All @@ -232,6 +234,8 @@ public function paginate($limit = null, $columns = ['*'])
return parent::paginate($limit, $columns);
});

$this->resetModel();
$this->resetScope();
return $value;
}

Expand All @@ -255,6 +259,8 @@ public function find($id, $columns = ['*'])
return parent::find($id, $columns);
});

$this->resetModel();
$this->resetScope();
return $value;
}

Expand All @@ -279,6 +285,8 @@ public function findByField($field, $value = null, $columns = ['*'])
return parent::findByField($field, $value, $columns);
});

$this->resetModel();
$this->resetScope();
return $value;
}

Expand All @@ -302,6 +310,8 @@ public function findWhere(array $where, $columns = ['*'])
return parent::findWhere($where, $columns);
});

$this->resetModel();
$this->resetScope();
return $value;
}

Expand All @@ -324,6 +334,8 @@ public function getByCriteria(CriteriaInterface $criteria)
return parent::getByCriteria($criteria);
});

$this->resetModel();
$this->resetScope();
return $value;
}
}

0 comments on commit b95fc26

Please sign in to comment.