You are here

ManualCertificateMapper.php in Certificate 4.x

File

src/Plugin/certificate/CertificateMapper/ManualCertificateMapper.php
View source
<?php

namespace Drupal\certificate\Plugin\certificate\CertificateMapper;

use Drupal\certificate\Plugin\CertificateMapperBase;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Session\AccountInterface;

/**
 * @CertificateMapper(
 *  id = "manual",
 *  label = @Translation("Manual"),
 *  description = @Translation("Select a single certificate to award to the user"),
 * )
 */
class ManualCertificateMapper extends CertificateMapperBase {
  public function getMapKeys() {
    return [
      'manual' => 'Manual',
    ];
  }
  public function processMapping(ContentEntityInterface $entity, AccountInterface $account) {
    return [
      'manual',
    ];
  }

}

Classes

Namesort descending Description
ManualCertificateMapper Plugin annotation @CertificateMapper( id = "manual", label = @Translation("Manual"), description = @Translation("Select a single certificate to award to the user"), )