user_email_verification-8.x-1.0/src/Plugin/ECA/Condition/IsUserVerificationPeriodExceeded.php

src/Plugin/ECA/Condition/IsUserVerificationPeriodExceeded.php
<?php

namespace Drupal\user_email_verification\Plugin\ECA\Condition;

use Drupal\eca_user\Plugin\ECA\Condition\UserTrait;
use Drupal\user\UserInterface;

/**
 * Plugin implementation of the ECA condition if a requested user email verification period exceeded.
 *
 * @EcaCondition(
 *   id = "user_email_verification_period_exceeded",
 *   label = @Translation("User Email Verification: Is email verification period exceeded"),
 *   description = @Translation("Checks is email verification period exceeded for requested user or no."),
 *   eca_version_introduced = "1.0.0"
 * )
 */
class IsUserVerificationPeriodExceeded extends IsCurrentUserVerificationPeriodExceeded {

  use UserTrait;

  /**
   * {@inheritdoc}
   */
  public function evaluate(): bool {
    $account = $this->loadUserAccount();

    if ($account instanceof UserInterface && $account->isAuthenticated()) {
      return $this->negationCheck(
        $this->userEmailVerification->isVerificationPeriodExceeded($account->id())
      );
    }

    return $this->negationCheck(FALSE);
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc