You are here

public function EmailConfirmation::setPrivate in Email confirmer 8

Mark the confirmation as private.

A private confirmation can only be replied by their owner or by email confirmation administrators. It has no effect on confirmations owned by the anonymous user.

Parameters

bool $private: The new private status. TRUE when no given argument.

Return value

\Drupal\email_confirmer\EmailConfirmationInterface The called email confirmation entity.

Overrides EmailConfirmationInterface::setPrivate

File

src/Entity/EmailConfirmation.php, line 218

Class

EmailConfirmation
Defines the email confirmation entity class.

Namespace

Drupal\email_confirmer\Entity

Code

public function setPrivate($private = TRUE) {
  $this
    ->get('private')
    ->setValue($private ? EmailConfirmationInterface::IS_PRIVATE : EmailConfirmationInterface::IS_PUBLIC);
  return $this;
}