You are here

RelationInterface.php in Relation 8

Same filename and directory in other branches
  1. 8.2 src/RelationInterface.php

Namespace

Drupal\relation

File

src/RelationInterface.php
View source
<?php

/**
 * @file
 * Contains \Drupal\relation\RelationInterface.
 */
namespace Drupal\relation;

use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Entity\EntityChangedInterface;
use Drupal\user\EntityOwnerInterface;

/**
 * Provides an interface defining a Relation entity.
 */
interface RelationInterface extends ContentEntityInterface, EntityChangedInterface, EntityOwnerInterface {

  /**
   * Filters endpoints by entity type.
   *
   * Suitable for direct usage with entity_load_multiple().
   *
   * Example:
   *
   * @code
   * $endpoints = $relation->endpoints();
   * $users = entity_load_multiple('user', $endpoints['user']);
   * @endcode
   *
   * Sample return value:
   *
   * @code
   * array(
   *   "node" => array(5),
   *   "user" => array(2),
   * );
   * @endcode
   *
   * @return array
   *   An array where keys are entity type, and values are arrays containing
   *   entity IDs of endpoints.
   */
  public function endpoints();

}

Interfaces

Namesort descending Description
RelationInterface Provides an interface defining a Relation entity.