You are here

public function Pool::setTimestamp in CMS Content Sync 2.1.x

Same name and namespace in other branches
  1. 8 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 275

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();
  }
}