You are here

public function Subscriber::setStatus in Simplenews 3.x

Same name and namespace in other branches
  1. 8.2 src/Entity/Subscriber.php \Drupal\simplenews\Entity\Subscriber::setStatus()
  2. 8 src/Entity/Subscriber.php \Drupal\simplenews\Entity\Subscriber::setStatus()

Sets the status of the subscriber.

Parameters

bool $status: The subscribers status.

Overrides SubscriberInterface::setStatus

1 call to Subscriber::setStatus()
Subscriber::fillFromAccount in src/Entity/Subscriber.php
Fill values from a user account.

File

src/Entity/Subscriber.php, line 83

Class

Subscriber
Defines the simplenews subscriber entity.

Namespace

Drupal\simplenews\Entity

Code

public function setStatus($status) {
  $this
    ->set('status', $status ? SubscriberInterface::ACTIVE : SubscriberInterface::INACTIVE);
}