Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Only flush cache when delete() returns a count #503

m-lotze started this conversation in Ideas
Discussion options

The two methods delete and forceDelete in Buildable trait should imho only flush the cache, if the parent methods return an int > 0. Right now, the cache is flushed every time, even when the query did not actually deleted records from the database.

public function delete()
{
 $result = parent::delete();
 if ($result) {
 $this->cache($this->makeCacheTags())->flush();
 }
 return $result;
}
You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
1 participant
Converted from issue

This discussion was converted from issue #435 on March 05, 2025 13:55.

AltStyle によって変換されたページ (->オリジナル) /