Pull merge.
[yaffs-website] / web / core / lib / Drupal / Core / Entity / EntityTypeInterface.php
index c8a28b4358f21e2eeda08015bdccf1b92d5ede92..b2c1f5d20edae0e66f95426644d2d5bcd248d1ae 100644 (file)
@@ -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.
    *