You are here

public function EntityStatus::resetStatus in CMS Content Sync 2.0.x

Same name and namespace in other branches
  1. 8 src/Entity/EntityStatus.php \Drupal\cms_content_sync\Entity\EntityStatus::resetStatus()
  2. 2.1.x src/Entity/EntityStatus.php \Drupal\cms_content_sync\Entity\EntityStatus::resetStatus()

Parameters

$entity:

File

src/Entity/EntityStatus.php, line 247

Class

EntityStatus
Defines the "Content Sync - Entity Status" entity type.

Namespace

Drupal\cms_content_sync\Entity

Code

public function resetStatus() {
  $this
    ->setLastPush(null);
  $this
    ->setLastPull(null);
  $this
    ->save();

  // Above cache clearing doesn't work reliably. So we reset the whole entity cache.
  \Drupal::service('cache.entity')
    ->deleteAll();
}