You are here

ContributorRole.php in Bibliography & Citation 8

Same filename and directory in other branches
  1. 2.0.x modules/bibcite_entity/src/Entity/ContributorRole.php

File

modules/bibcite_entity/src/Entity/ContributorRole.php
View source
<?php

namespace Drupal\bibcite_entity\Entity;

use Drupal\Core\Config\Entity\ConfigEntityBase;

/**
 * Defines the Contributor role entity.
 *
 * @ConfigEntityType(
 *   id = "bibcite_contributor_role",
 *   label = @Translation("Contributor role"),
 *   handlers = {
 *     "list_builder" = "Drupal\bibcite_entity\ContributorRoleListBuilder",
 *     "form" = {
 *       "add" = "Drupal\bibcite_entity\Form\ContributorRoleForm",
 *       "edit" = "Drupal\bibcite_entity\Form\ContributorRoleForm",
 *       "delete" = "Drupal\bibcite_entity\Form\ContributorRoleDeleteForm"
 *     },
 *   },
 *   config_prefix = "bibcite_contributor_role",
 *   admin_permission = "administer bibcite_reference",
 *   entity_keys = {
 *     "id" = "id",
 *     "label" = "label",
 *     "uuid" = "uuid",
 *     "weight" = "weight"
 *   },
 *   links = {
 *     "add-form" = "/admin/structure/bibcite/contributor/settings/role/add",
 *     "edit-form" = "/admin/structure/bibcite/contributor/settings/role/{bibcite_contributor_role}",
 *     "delete-form" = "/admin/structure/bibcite/contributor/settings/role/{bibcite_contributor_role}/delete",
 *     "collection" = "/admin/structure/bibcite/contributor/settings/role"
 *   },
 *   config_export = {
 *     "id",
 *     "label",
 *     "weight",
 *   }
 * )
 */
class ContributorRole extends ConfigEntityBase implements ContributorRoleInterface {

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

  /**
   * The Contributor role label.
   *
   * @var string
   */
  protected $label;

  /**
   * The Contributor role weight.
   *
   * @var string
   */
  protected $weight;

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

  /**
   * {@inheritdoc}
   */
  public function setWeight($weight) {
    return $this
      ->set('weight', $weight);
  }

}

Classes

Namesort descending Description
ContributorRole Defines the Contributor role entity.