You are here

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

Returns the information if the entity has been chosen by the user to be pushed with this flow and pool.

Parameters

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

bool $setDependency: Optional parameter to set the value for DependencyPushEnabled

Return value

bool

File

src/Entity/EntityStatus.php, line 605

Class

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

Namespace

Drupal\cms_content_sync\Entity

Code

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