You are here

EntityLegalDocument.php in Entity Legal 8

File

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

/**
 * @file
 * Contains \Drupal\entity_legal\Entity\EntityLegalDocument.
 */
namespace Drupal\entity_legal\Entity;

use Drupal\Core\Config\Entity\ConfigEntityBase;
use Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery;
use Drupal\entity_legal\Entity\EntityLegalDocumentInterface;

/**
 * Defines the 'entity_legal_document' config entity.
 *
 * @ConfigEntityType(
 *   id = "entity_legal_document",
 *   label = @Translation("Legal Document"),
 *   handlers = {
 *     "list_builder" = "Drupal\entity_legal\Controller\EntityLegalDocumentListBuilder",
 *     "form" = {
 *       "add" = "Drupal\entity_legal\Form\EntityLegalDocumentForm",
 *       "edit" = "Drupal\entity_legal\Form\EntityLegalDocumentForm",
 *       "delete" = "Drupal\entity_legal\Form\EntityLegalDocumentDeleteForm"
 *     }
 *   },
 *   config_prefix = "entity_legal_document",
 *   admin_permission = "administer entity legal",
 *   entity_keys = {
 *     "id" = "id",
 *     "label" = "label"
 *   },
 *   links = {
 *     "edit-form" = "/admin/structure/legal/manage/{entity_legal_document}",
 *     "delete-form" = "/admin/structure/legal/manage/{entity_legal_document}/delete"
 *   }
 * )
 */
class EntityLegalDocument extends ConfigEntityBase implements EntityLegalDocumentInterface {

  /**
   * The Legal Document id.
   *
   * @var string
   */
  public $id;

  /**
   * The Legal Document label.
   *
   * @var string
   */
  public $label;

  /**
   * The settings for requirement methods.
   *
   * @var array
   */
  protected $settings;

  /**
   * {@inheritdoc}
   */
  public function getPublishedVersionName() {
    return $this
      ->get('published_version');
  }

  /**
   * {@inheritdoc}
   */
  public function getNewUserRequirement() {
    return $this
      ->get('new_user_requirement');
  }

  /**
   * {@inheritdoc}
   */
  public function getExistingUserRequirement() {
    return $this
      ->get('existing_user_requirement');
  }

  /**
   * {@inheritdoc}
   */
  public function getNewUserPluginName() {
    return $this
      ->get('new_user_plugin_name');
  }

  /**
   * {@inheritdoc}
   */
  public function getExistingUserPluginName() {
    return $this
      ->get('existing_user_plugin_name');
  }

}

Classes

Namesort descending Description
EntityLegalDocument Defines the 'entity_legal_document' config entity.