You are here

public function CrmCoreUserSyncRelationRules::valid in CRM Core 8.3

Same name and namespace in other branches
  1. 8 modules/crm_core_user_sync/src/CrmCoreUserSyncRelationRules.php \Drupal\crm_core_user_sync\CrmCoreUserSyncRelationRules::valid()

Checks if provided contact can be linked to this account.

Parameters

\Drupal\user\UserInterface $account: User account to check.

\Drupal\crm_core_contact\IndividualInterface $contact: Contact record to check.

Return value

bool TRUE if the contact is valid.

File

modules/crm_core_user_sync/src/CrmCoreUserSyncRelationRules.php, line 89

Class

CrmCoreUserSyncRelationRules
CrmCoreUserSyncRelation service.

Namespace

Drupal\crm_core_user_sync

Code

public function valid(UserInterface $account, IndividualInterface $contact) {
  return $contact
    ->bundle() === $this
    ->getContactType($account);
}