public function Subscription::setStatus in Mailing List 8
Sets the subscription status.
Parameters
bool $status: TRUE to set this subscription as active, FALSE to set it as inactive.
Return value
\Drupal\mailing_list\SubscriptionInterface The called subscription entity.
Overrides SubscriptionInterface::setStatus
1 call to Subscription::setStatus()
- Subscription::preSave in src/
Entity/ Subscription.php - Acts on an entity before the presave hook is invoked.
File
- src/
Entity/ Subscription.php, line 161
Class
- Subscription
- Defines the subscription entity class.
Namespace
Drupal\mailing_list\EntityCode
public function setStatus($status) {
$this
->set('status', $status ? SubscriptionInterface::ACTIVE : SubscriptionInterface::INACTIVE);
return $this;
}