You are here

public function Pool::setTimestamp in CMS Content Sync 8

Same name and namespace in other branches
  1. 2.1.x src/Entity/Pool.php \Drupal\cms_content_sync\Entity\Pool::setTimestamp()
  2. 2.0.x src/Entity/Pool.php \Drupal\cms_content_sync\Entity\Pool::setTimestamp()

Get the newest pull/push timestamp for this pool from all status entities that exist for the given entity.

Parameters

$entity_type:

$entity_uuid:

int $timestamp:

bool $pull:

File

src/Entity/Pool.php, line 260

Class

Pool
Defines the "Content Sync - Pool" entity.

Namespace

Drupal\cms_content_sync\Entity

Code

public function setTimestamp($entity_type, $entity_uuid, $timestamp, $pull = true) {
  $entity_status = EntityStatus::getInfoForPool($entity_type, $entity_uuid, $this);
  foreach ($entity_status as $info) {
    if ($pull) {
      $info
        ->setLastPull($timestamp);
    }
    else {
      $info
        ->setLastPush($timestamp);
    }
    $info
      ->save();
  }
}