You are here

public function UserHasFacebookAccessToken::evaluate in Simple FB Connect 8.3

Evaluates the condition and returns TRUE or FALSE accordingly.

Return value

bool TRUE if the condition has been met, FALSE otherwise.

Overrides RulesConditionBase::evaluate

File

modules/simple_fb_connect_rules/src/Plugin/Condition/UserHasFacebookAccessToken.php, line 62

Class

UserHasFacebookAccessToken
Provides a 'User has a Facebook access token' condition.

Namespace

Drupal\simple_fb_connect_rules\Plugin\Condition

Code

public function evaluate() {

  // Check that access token is found and that is is not expired.
  if ($token = $this->persistentDataHandler
    ->get('access_token')) {
    if ($token->isExpired !== TRUE) {
      return TRUE;
    }
  }
  return FALSE;
}