Skip to content

Commit

Permalink
ContentType::update can now omit cache clearing
Browse files Browse the repository at this point in the history
By setting the option 'clearCache' to false the cache clearing
will be skipped.
  • Loading branch information
am0s committed Jan 21, 2020
1 parent 824dfc7 commit 288de28
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Aplia/Content/ContentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ public function remove($allowNoExists=false)
*
* @return self
*/
public function update()
public function update($options = array())
{
$contentClass = $this->getContentClass();
$isDirty = false;
Expand Down Expand Up @@ -682,7 +682,10 @@ public function update()
$handler->setTimestamp( 'sort-key-cache', $time );
$handler->store();

\eZContentCacheManager::clearAllContentCache();
$clearCache = Arr::get($options, 'clearCache', true);
if ($clearCache) {
\eZContentCacheManager::clearAllContentCache();
}

return $this;
}
Expand Down

0 comments on commit 288de28

Please sign in to comment.