X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FEntity%2FEntityTypeInterface.php;h=b2c1f5d20edae0e66f95426644d2d5bcd248d1ae;hb=refs%2Fheads%2Fd864;hp=c8a28b4358f21e2eeda08015bdccf1b92d5ede92;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/lib/Drupal/Core/Entity/EntityTypeInterface.php b/web/core/lib/Drupal/Core/Entity/EntityTypeInterface.php index c8a28b435..b2c1f5d20 100644 --- a/web/core/lib/Drupal/Core/Entity/EntityTypeInterface.php +++ b/web/core/lib/Drupal/Core/Entity/EntityTypeInterface.php @@ -7,10 +7,19 @@ use Drupal\Component\Plugin\Definition\PluginDefinitionInterface; /** * Provides an interface for an entity type and its metadata. * - * Additional information can be provided by modules: hook_entity_type_build() can be - * implemented to define new properties, while hook_entity_type_alter() can be - * implemented to alter existing data and fill-in defaults. Module-specific - * properties should be documented in the hook implementations defining them. + * Entity type classes can provide docblock annotations. The entity type manager + * will use these annotations to populate the entity type object with + * properties. + * + * Additional properties can be defined by module implementations of + * hook_entity_type_build(). Existing data can be altered in implementations of + * hook_entity_type_alter(), which can also be used to fill in defaults. + * Module-specific properties should be documented in the hook implementations + * defining them. + * + * @see \Drupal\Core\Entity\EntityTypeManagerInterface + * @see hook_entity_type_build() + * @see hook_entity_type_alter() */ interface EntityTypeInterface extends PluginDefinitionInterface { @@ -326,10 +335,10 @@ interface EntityTypeInterface extends PluginDefinitionInterface { public function getAccessControlClass(); /** - * Gets the access class. + * Sets the access control handler class. * * @param string $class - * The class for this entity type's access. + * The class for this entity type's access control handler. * * @return $this */ @@ -547,8 +556,8 @@ interface EntityTypeInterface extends PluginDefinitionInterface { /** * Gets the label for the bundle. * - * @return string|null - * The bundle label, or NULL if none exists. + * @return string + * The bundle label. */ public function getBundleLabel(); @@ -562,6 +571,24 @@ interface EntityTypeInterface extends PluginDefinitionInterface { */ public function getBaseTable(); + /** + * Indicates whether the entity data is internal. + * + * This can be used in a scenario when it is not desirable to expose data of + * this entity type to an external system. + * + * The implications of this method are left to the discretion of the caller. + * For example, a module providing an HTTP API may not expose entities of + * this type or a custom entity reference field settings form may deprioritize + * entities of this type in a select list. + * + * @return bool + * TRUE if the entity data is internal, FALSE otherwise. + * + * @see \Drupal\Core\TypedData\DataDefinitionInterface::isInternal() + */ + public function isInternal(); + /** * Indicates whether entities of this type have multilingual support. *