You are here

public function EntityLegalDocument::getAcceptanceDeliveryMethod in Entity Legal 3.0.x

Same name and namespace in other branches
  1. 8.2 src/Entity/EntityLegalDocument.php \Drupal\entity_legal\Entity\EntityLegalDocument::getAcceptanceDeliveryMethod()
  2. 4.0.x src/Entity/EntityLegalDocument.php \Drupal\entity_legal\Entity\EntityLegalDocument::getAcceptanceDeliveryMethod()

Get the acceptance delivery method for a given user type.

Parameters

bool $new_user: Get the method for new signups or existing accounts.

Return value

string The acceptance delivery method.

Overrides EntityLegalDocumentInterface::getAcceptanceDeliveryMethod

File

src/Entity/EntityLegalDocument.php, line 294

Class

EntityLegalDocument
Defines the entity legal document entity.

Namespace

Drupal\entity_legal\Entity

Code

public function getAcceptanceDeliveryMethod($new_user = FALSE) {
  $setting_group = $new_user ? 'new_users' : 'existing_users';
  return isset($this
    ->get('settings')[$setting_group]['require_method']) ? $this
    ->get('settings')[$setting_group]['require_method'] : FALSE;
}