You are here

Party.php in Party 8.2

File

lib/Drupal/party/Plugin/Core/Entity/Party.php
View source
<?php

/**
 * @file
 * Definition of Drupal\party\Plugin\Core\Entity\Party.
 */
namespace Drupal\party\Plugin\Core\Entity;

use Drupal\Core\Entity\Entity;
use Drupal\Core\Entity\EntityStorageControllerInterface;
use Drupal\Core\Entity\Annotation\EntityType;
use Drupal\Core\Annotation\Translation;

/**
 * Defines the Party class to extend users to work as an anonymous user API.
 *
 * @EntityType(
 *   id = "party",
 *   label = @Translation("Party"),
 *   module = "party",
 *   controllers = {
 *     "storage" = "Drupal\party\PartyStorageController",
 *     "render" = "Drupal\Core\Entity\EntityRenderController",
 *     "access" = "Drupal\Core\Entity\EntityAccessController",
 *     "form" = {
 *       "default" = "Drupal\Core\Entity\EntityFormController",
 *       "edit" = "Drupal\Core\Entity\EntityFormController"
 *     }
 *   },
 *   base_table = "party",
 *   uri_callback = "party_uri",
 *   label_callback = "party_label",
 *   fieldable = TRUE,
 *   entity_keys = {
 *     "id" = "pid",
 *     "label" = "label",
 *     "uuid" = "uuid"
 *   }
 * )
 */
class Party extends Entity {

  /**
   * The party ID.
   *
   * @var integer
   */
  public $pid;

  /**
   * The uid of the User the party is mocking up.
   *
   * @var integer
   */
  public $uid;

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

  /**
   * The label of the party.
   *
   * @var string
   */
  public $label = '';

  /**
   * The party's email address.
   *
   * @var string
   */
  public $mail = '';

  /**
   * Implements Drupal\Core\Entity\EntityInterface::id()
   */
  public function id() {
    return $this->pid;
  }

}

Classes

Namesort descending Description
Party Defines the Party class to extend users to work as an anonymous user API.