You are here

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

Returns the information if the user allowed the push.

Parameters

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

Return value

bool

File

src/Entity/EntityStatus.php, line 750

Class

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

Namespace

Drupal\cms_content_sync\Entity

Code

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