You are here

CourierContext.php in Courier 2.x

Same filename and directory in other branches
  1. 8 src/Entity/CourierContext.php

File

src/Entity/CourierContext.php
View source
<?php

namespace Drupal\courier\Entity;

use Drupal\Core\Config\Entity\ConfigEntityBase;
use Drupal\courier\CourierContextInterface;

/**
 * Defines a courier_context configuration entity.
 *
 * @ConfigEntityType(
 *   id = "courier_context",
 *   label = @Translation("Courier context"),
 *   config_prefix = "context",
 *   entity_keys = {
 *     "id" = "id",
 *     "label" = "label",
 *   },
 *   config_export = {
 *     "id",
 *     "label",
 *     "tokens",
 *   }
 * )
 */
class CourierContext extends ConfigEntityBase implements CourierContextInterface {

  /**
   * The context ID.
   *
   * @var string
   */
  protected $id;

  /**
   * The context label.
   *
   * @var string
   */
  protected $label;

  /**
   * An array of token names.
   *
   * @var array
   */
  protected $tokens;

  /**
   * {@inheritdoc}
   */
  public function getTokens() {
    return array_merge($this->tokens, [
      'identity',
    ]);
  }

}

Classes

Namesort descending Description
CourierContext Defines a courier_context configuration entity.