You are here

class Party in Party 7

Same name and namespace in other branches
  1. 8.2 includes/party.entity.inc \Party

The class used for party entities.

Hierarchy

Expanded class hierarchy of Party

26 string references to 'Party'
attached_entity_from_party.inc in plugins/relationships/attached_entity_from_party.inc
Plugin to provide an relationship handler for term from node.
PartyAccessTestCase::getInfo in tests/party_access.test
PartyAcquisitionTestCase::getInfo in tests/party_acquisition.test
PartyHatTestCase::getInfo in modules/party_hat/tests/party_hat.test
PartyPrimaryFields::getDataSetInfo in includes/party.primary_fields.inc
Get data set info including the spoofed party.

... See full list

File

includes/party.entity.inc, line 252
Contains the controller classes for Party entities.

View source
class Party extends Entity {

  /**
   * The internal, numeric party-id.
   *
   * @var integer
   */
  public $pid;

  /**
   * The human-readable label for the party.
   *
   * @var string
   *
   * @see PartyController::setLabel()
   */
  public $label;

  /**
   * Boolean indicating whether this party has been archived.
   *
   * Archiving parties provides a way to ignore parties from certain features
   * or restrict access. An example of when you would archive a party is when
   * the parties is deceased (in the case of a person) or no longer operates
   * (in the case of an organisation).
   *
   * @var boolean
   */
  public $archived;

  /**
   * Boolean indicating whether this party has been hidden.
   *
   * Hiding a party provides a way to remove a party from the system without
   * deleting and losing the data. An example of when you would hide a party
   * is on merging, where you would hide the party that is no longer used. This
   * is then completely hidden from all normal system processes, but it still
   * exists and can be loaded, for example to find out what party it has been
   * merged with.
   *
   * @var boolean
   */
  public $hidden;

  /**
   * If $merged is TRUE, this is the pid of the party that this party has been
   * merged into.
   *
   * @var integer
   */
  public $merged_party;

  /**
   * The primary email for this party.
   *
   * @var string
   */
  public $email;

  /**
   * A cache of data set controllers.
   *
   * @var array
   */
  public $data_set_controllers = array();
  public function __construct($values = array()) {
    parent::__construct($values, 'party');
  }

  /**
   * Return the default label for this party object.
   *
   * @return string
   *   Human readable label for the party object.
   */
  protected function defaultLabel() {
    return $this->label;
  }

  /**
   * Return the default path for this party.
   *
   * @return array
   *   An array with the following key:
   *   - path - the drupal path for the party.
   */
  protected function defaultUri() {
    return array(
      'path' => 'party/' . $this->pid,
    );
  }

  /**
   * Get a data set controller.
   */
  public function getDataSetController($data_set_name) {
    return entity_get_controller('party')
      ->getDataSetController($this, $data_set_name);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Entity::$defaultLabel protected property 1
Entity::$entityInfo protected property
Entity::$entityType protected property
Entity::$idKey protected property
Entity::$wrapper protected property
Entity::buildContent public function Builds a structured array representing the entity's content. Overrides EntityInterface::buildContent 1
Entity::bundle public function Returns the bundle of the entity. Overrides EntityInterface::bundle
Entity::delete public function Permanently deletes the entity. Overrides EntityInterface::delete
Entity::entityInfo public function Returns the info of the type of the entity. Overrides EntityInterface::entityInfo
Entity::entityType public function Returns the type of the entity. Overrides EntityInterface::entityType
Entity::export public function Exports the entity. Overrides EntityInterface::export
Entity::getTranslation public function Gets the raw, translated value of a property or field. Overrides EntityInterface::getTranslation
Entity::hasStatus public function Checks if the entity has a certain exportable status. Overrides EntityInterface::hasStatus
Entity::identifier public function Returns the entity identifier, i.e. the entities name or numeric id. Overrides EntityInterface::identifier
Entity::internalIdentifier public function Returns the internal, numeric identifier. Overrides EntityInterface::internalIdentifier
Entity::isDefaultRevision public function Checks whether the entity is the default revision. Overrides EntityInterface::isDefaultRevision
Entity::label public function Returns the label of the entity. Overrides EntityInterface::label
Entity::save public function Permanently saves the entity. Overrides EntityInterface::save
Entity::setUp protected function Set up the object instance on construction or unserializiation.
Entity::uri public function Returns the uri of the entity just as entity_uri(). Overrides EntityInterface::uri
Entity::view public function Generate an array for rendering the entity. Overrides EntityInterface::view
Entity::wrapper public function Returns the EntityMetadataWrapper of the entity. Overrides EntityInterface::wrapper
Entity::__sleep public function Magic method to only serialize what's necessary.
Entity::__wakeup public function Magic method to invoke setUp() on unserialization.
Party::$archived public property Boolean indicating whether this party has been archived.
Party::$data_set_controllers public property A cache of data set controllers.
Party::$email public property The primary email for this party.
Party::$hidden public property Boolean indicating whether this party has been hidden.
Party::$label public property The human-readable label for the party.
Party::$merged_party public property If $merged is TRUE, this is the pid of the party that this party has been merged into.
Party::$pid public property The internal, numeric party-id.
Party::defaultLabel protected function Return the default label for this party object. Overrides Entity::defaultLabel
Party::defaultUri protected function Return the default path for this party. Overrides Entity::defaultUri
Party::getDataSetController public function Get a data set controller.
Party::__construct public function Overrides Entity::__construct