You are here

public function EntityStatus::didPushFail 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::didPushFail()
  2. 2.1.x src/Entity/EntityStatus.php \Drupal\cms_content_sync\Entity\EntityStatus::didPushFail()

Returns the information if the last push of the entity failed.

Parameters

bool $set: Optional parameter to set the value for PushFailed

bool $soft: A soft fail- this was intended according to configuration. But the user might want to know why to debug different expectations.

null|array $details: If $set is TRUE, you can provide additional details on why the push failed. Can be gotten via ->whyDidPushFail()

Return value

bool

1 call to EntityStatus::didPushFail()
EntityStatus::setLastPush in src/Entity/EntityStatus.php
Set the last pull timestamp.

File

src/Entity/EntityStatus.php, line 528

Class

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

Namespace

Drupal\cms_content_sync\Entity

Code

public function didPushFail($set = null, $soft = false, $details = null) {
  $flag = $soft ? self::FLAG_PUSH_FAILED_SOFT : self::FLAG_PUSH_FAILED;
  if (true === $set) {
    $this
      ->set('flags', $this
      ->get('flags')->value | $flag);
    if (!empty($details)) {
      $this
        ->setData(self::DATA_PUSH_FAILURE, $details);
    }
  }
  elseif (false === $set) {
    $this
      ->set('flags', $this
      ->get('flags')->value & ~$flag);
    $this
      ->setData(self::DATA_PUSH_FAILURE, null);
  }
  return (bool) ($this
    ->get('flags')->value & $flag);
}