You are here

public function EntityStatus::wasPulledEmbedded in CMS Content Sync 8

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

Returns whether the entity was pulled embedded in another parent entity. This is always done for field collections but can also be enabled for other entities like paragraphs or media entities. This can save a lot of requests when entities aren't all syndicated individually.

Parameters

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

Return value

bool

File

src/Entity/EntityStatus.php, line 810

Class

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

Namespace

Drupal\cms_content_sync\Entity

Code

public function wasPulledEmbedded($set = null) {
  if (true === $set) {
    $this
      ->set('flags', $this
      ->get('flags')->value | self::FLAG_PULLED_EMBEDDED);
  }
  elseif (false === $set) {
    $this
      ->set('flags', $this
      ->get('flags')->value & ~self::FLAG_PULLED_EMBEDDED);
  }
  return (bool) ($this
    ->get('flags')->value & self::FLAG_PULLED_EMBEDDED);
}