public function TestCertificateMapper::processMapping in Certificate 4.x
Get the map keys that the user is eligible for.
Return value
array
Overrides CertificateMapperBase::processMapping
File
- modules/
certificate_test/ src/ Plugin/ certificate/ CertificateMapper/ TestCertificateMapper.php, line 22
Class
- TestCertificateMapper
- Plugin annotation @CertificateMapper( id = "firstletter", label = @Translation("Test mapper"), description = @Translation("Map based on first letter of username"), )
Namespace
Drupal\certificate_test\Plugin\certificate\CertificateMapperCode
public function processMapping(ContentEntityInterface $entity, AccountInterface $account) {
return [
$account
->getAccountName()[0],
];
}