class Category

Defines the contact category entity.

Plugin annotation


@Plugin(
  id = "contact_category",
  label = @Translation("Category"),
  module = "contact",
  controller_class = "Drupal\Core\Config\Entity\ConfigStorageController",
  list_controller_class = "Drupal\contact\CategoryListController",
  form_controller_class = {
    "default" = "Drupal\contact\CategoryFormController"
  },
  uri_callback = "contact_category_uri",
  config_prefix = "contact.category",
  entity_keys = {
    "id" = "id",
    "label" = "label",
    "uuid" = "uuid"
  }
)

Hierarchy

Expanded class hierarchy of Category

2 files declare their use of Category
contact.admin.inc in drupal/core/modules/contact/contact.admin.inc
Admin page callbacks for the Contact module.
contact.module in drupal/core/modules/contact/contact.module
Enables the use of personal and site-wide contact forms.
3 string references to 'Category'
CategoryListController::buildHeader in drupal/core/modules/contact/lib/Drupal/contact/CategoryListController.php
Overrides Drupal\Core\Entity\EntityListController::buildHeader().
ContactSitewideTest::testSiteWideContact in drupal/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php
Tests configuration options and the site-wide contact form.
contact_site_form in drupal/core/modules/contact/contact.pages.inc
Page callback: Form constructor for the site-wide contact form.

File

drupal/core/modules/contact/lib/Drupal/contact/Plugin/Core/Entity/Category.php, line 35
Definition of Drupal\contact\Plugin\Core\Entity\Category.

Namespace

Drupal\contact\Plugin\Core\Entity
View source
class Category extends ConfigEntityBase {

  /**
   * The category ID.
   *
   * @var string
   */
  public $id;

  /**
   * The category UUID.
   *
   * @var string
   */
  public $uuid;

  /**
   * The category label.
   *
   * @var string
   */
  public $label;

  /**
   * List of recipient e-mail addresses.
   *
   * @var array
   */
  public $recipients = array();

  /**
   * An auto-reply message to send to the message author.
   *
   * @var string
   */
  public $reply = '';

  /**
   * Weight of this category (used for sorting).
   *
   * @var int
   */
  public $weight = 0;

}

Members

Namesort descending Modifiers Type Description Overrides
Category::$id public property The category ID.
Category::$label public property The category label.
Category::$recipients public property List of recipient e-mail addresses.
Category::$reply public property An auto-reply message to send to the message author.
Category::$uuid public property The category UUID.
Category::$weight public property Weight of this category (used for sorting).
ConfigEntityBase::$originalID protected property The original ID of the configuration entity.
ConfigEntityBase::createDuplicate public function Overrides Entity::createDuplicate(). Overrides Entity::createDuplicate 1
ConfigEntityBase::get public function Overrides Entity::get(). Overrides Entity::get 1
ConfigEntityBase::getOriginalID public function Implements ConfigEntityInterface::getOriginalID(). Overrides ConfigEntityInterface::getOriginalID
ConfigEntityBase::isNew final public function Overrides Entity::isNew(). Overrides Entity::isNew
ConfigEntityBase::set public function Overrides Entity::set(). Overrides Entity::set
ConfigEntityBase::setOriginalID public function Implements ConfigEntityInterface::setOriginalID(). Overrides ConfigEntityInterface::setOriginalID
ConfigEntityBase::sort public static function Helper callback for uasort() to sort configuration entities by weight and label.
ConfigEntityBase::__construct public function Overrides Entity::__construct(). Overrides Entity::__construct 2
Entity::$enforceIsNew protected property Boolean indicating whether the entity should be forced to be new.
Entity::$entityType protected property The entity type.
Entity::$isDefaultRevision protected property Indicates whether this is the default revision. 1
Entity::$langcode public property The language code of the entity's default language. 4
Entity::$newRevision protected property Boolean indicating whether a new revision should be created on save.
Entity::access public function Implements AccessibleInterface::access(). Overrides AccessibleInterface::access
Entity::bundle public function Implements EntityInterface::bundle(). Overrides EntityInterface::bundle 4
Entity::delete public function Implements EntityInterface::delete(). Overrides EntityInterface::delete
Entity::enforceIsNew public function Implements EntityInterface::enforceIsNew(). Overrides EntityInterface::enforceIsNew
Entity::entityInfo public function Implements EntityInterface::entityInfo(). Overrides EntityInterface::entityInfo
Entity::entityType public function Implements EntityInterface::entityType(). Overrides EntityInterface::entityType
Entity::getIterator public function Implements ComplexDataInterface::getIterator(). 1
Entity::getProperties public function Implements ComplexDataInterface::getProperties(). Overrides ComplexDataInterface::getProperties 1
Entity::getPropertyDefinition public function Implements ComplexDataInterface::getPropertyDefinition(). Overrides ComplexDataInterface::getPropertyDefinition 1
Entity::getPropertyDefinitions public function Implements ComplexDataInterface::getPropertyDefinitions(). Overrides ComplexDataInterface::getPropertyDefinitions 1
Entity::getPropertyValues public function Implements ComplexDataInterface::getPropertyValues(). Overrides ComplexDataInterface::getPropertyValues 1
Entity::getRevisionId public function Implements Drupal\Core\Entity\EntityInterface::getRevisionId(). Overrides EntityInterface::getRevisionId 3
Entity::getTranslation public function Implements TranslatableInterface::getTranslation(). Overrides TranslatableInterface::getTranslation 1
Entity::getTranslationLanguages public function Implements TranslatableInterface::getTranslationLanguages(). Overrides TranslatableInterface::getTranslationLanguages 1
Entity::id public function Implements EntityInterface::id(). Overrides EntityInterface::id 10
Entity::isDefaultRevision public function Implements Drupal\Core\Entity\EntityInterface::isDefaultRevision(). Overrides EntityInterface::isDefaultRevision 1
Entity::isEmpty public function Implements ComplexDataInterface::isEmpty(). Overrides ComplexDataInterface::isEmpty 1
Entity::isNewRevision public function Implements EntityInterface::isNewRevision(). Overrides EntityInterface::isNewRevision
Entity::label public function Implements EntityInterface::label(). Overrides EntityInterface::label 1
Entity::language public function Implements TranslatableInterface::language(). Overrides TranslatableInterface::language 1
Entity::save public function Implements EntityInterface::save(). Overrides EntityInterface::save 3
Entity::setNewRevision public function Implements EntityInterface::setNewRevision(). Overrides EntityInterface::setNewRevision
Entity::setPropertyValues public function Implements ComplexDataInterface::setPropertyValues(). Overrides ComplexDataInterface::setPropertyValues 1
Entity::translations public function Returns the languages the entity is translated to.
Entity::uri public function Implements EntityInterface::uri(). Overrides EntityInterface::uri 1
Entity::uuid public function Implements EntityInterface::uuid(). Overrides EntityInterface::uuid 1