Commit 71711656 authored by alexpott's avatar alexpott

Issue #2471653 by bojanz, Kazanir: Standardize getter docblocks in Drupal\Core\Entity

parent ec9c4b06
......@@ -981,7 +981,7 @@ public function referencedEntities() {
}
/**
* Returns the value of the given entity key, if defined.
* Gets the value of the given entity key, if defined.
*
* @param string $key
* Name of the entity key, for example id, revision or bundle.
......
......@@ -16,7 +16,7 @@
interface ContentEntityFormInterface extends EntityFormInterface {
/**
* Returns the form display.
* Gets the form display.
*
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
......@@ -40,7 +40,7 @@ public function getFormDisplay(FormStateInterface $form_state);
public function setFormDisplay(EntityFormDisplayInterface $form_display, FormStateInterface $form_state);
/**
* Returns the code identifying the active form language.
* Gets the code identifying the active form language.
*
* @param \Drupal\Core\Form\FormStateInterface $form_state
* The current state of the form.
......
......@@ -72,7 +72,7 @@ public function setComponent($name, array $options = array());
public function removeComponent($name);
/**
* Returns the highest weight of the components in the display.
* Gets the highest weight of the components in the display.
*
* @return int|null
* The highest weight of the components in the display, or NULL if the
......@@ -81,7 +81,7 @@ public function removeComponent($name);
public function getHighestWeight();
/**
* Returns the renderer plugin for a field (e.g. widget, formatter).
* Gets the renderer plugin for a field (e.g. widget, formatter).
*
* @param string $field_name
* The field name.
......@@ -92,7 +92,7 @@ public function getHighestWeight();
public function getRenderer($field_name);
/**
* Returns the entity type for which this display is used.
* Gets the entity type for which this display is used.
*
* @return string
* The entity type id.
......@@ -100,7 +100,7 @@ public function getRenderer($field_name);
public function getTargetEntityTypeId();
/**
* Returns the view or form mode to be displayed.
* Gets the view or form mode to be displayed.
*
* @return string
* The mode to be displayed.
......@@ -108,7 +108,7 @@ public function getTargetEntityTypeId();
public function getMode();
/**
* Returns the original view or form mode that was requested.
* Gets the original view or form mode that was requested.
*
* @return string
* The original mode that was requested.
......@@ -116,7 +116,7 @@ public function getMode();
public function getOriginalMode();
/**
* Returns the bundle to be displayed.
* Gets the bundle to be displayed.
*
* @return string
* The bundle to be displayed.
......
......@@ -15,7 +15,7 @@
interface EntityViewDisplayInterface extends EntityDisplayInterface {
/**
* Returns a renderable array for the components of an entity.
* Builds a renderable array for the components of an entity.
*
* See the buildMultiple() method for details.
*
......@@ -30,7 +30,7 @@ interface EntityViewDisplayInterface extends EntityDisplayInterface {
public function build(FieldableEntityInterface $entity);
/**
* Returns a renderable array for the components of a set of entities.
* Builds a renderable array for the components of a set of entities.
*
* This only includes the components handled by the Display object, but
* excludes 'extra fields', that are typically rendered through specific,
......
......@@ -67,7 +67,7 @@ public function __construct(array $values, $entity_type) {
}
/**
* Returns the entity manager.
* Gets the entity manager.
*
* @return \Drupal\Core\Entity\EntityManagerInterface
*/
......@@ -76,7 +76,7 @@ protected function entityManager() {
}
/**
* Returns the language manager.
* Gets the language manager.
*
* @return \Drupal\Core\Language\LanguageManagerInterface
*/
......@@ -85,7 +85,7 @@ protected function languageManager() {
}
/**
* Returns the UUID generator.
* Gets the UUID generator.
*
* @return \Drupal\Component\Uuid\UuidInterface
*/
......@@ -235,7 +235,7 @@ public function hasLinkTemplate($rel) {
}
/**
* Returns an array link templates.
* Gets an array link templates.
*
* @return array
* An array of link templates containing paths.
......@@ -274,7 +274,7 @@ public function url($rel = 'canonical', $options = array()) {
}
/**
* Returns an array of placeholders for this entity.
* Gets an array of placeholders for this entity.
*
* Individual entity classes may override this method to add additional
* placeholders if desired. If so, they should be sure to replicate the
......
......@@ -34,7 +34,7 @@ public function __construct(SelectionPluginManagerInterface $selection_manager)
}
/**
* Returns matched labels based on a given search string.
* Gets matched labels based on a given search string.
*
* @param string $target_type
* The ID of the target entity type.
......
......@@ -22,7 +22,7 @@
interface EntityChangedInterface {
/**
* Returns the timestamp of the last entity change.
* Gets the timestamp of the last entity change.
*
* @return int
* The timestamp of the last entity save operation.
......
......@@ -146,7 +146,7 @@ public function applyUpdates() {
}
/**
* Returns a list of changes to entity type and field storage definitions.
* Gets a list of changes to entity type and field storage definitions.
*
* @return array
* An associative array keyed by entity type id of change descriptors. Every
......
......@@ -64,7 +64,7 @@ interface EntityDefinitionUpdateManagerInterface {
public function needsUpdates();
/**
* Returns a human readable summary of the detected changes.
* Gets a human readable summary of the detected changes.
*
* @return array
* An associative array keyed by entity type id. Each entry is an array of
......
......@@ -22,7 +22,7 @@ trait EntityDeleteFormTrait {
use ConfigDependencyDeleteFormTrait;
/**
* Returns the entity of this form.
* Gets the entity of this form.
*
* Provided by \Drupal\Core\Entity\EntityForm.
*
......@@ -62,7 +62,7 @@ public function getConfirmText() {
}
/**
* Returns the message to display to the user after deleting the entity.
* Gets the message to display to the user after deleting the entity.
*
* @return string
* The translated string of the deletion message.
......
......@@ -388,7 +388,7 @@ public function getHighestWeight() {
}
/**
* Returns the field definition of a field.
* Gets the field definition of a field.
*/
protected function getFieldDefinition($field_name) {
$definitions = $this->getFieldDefinitions();
......@@ -396,7 +396,7 @@ protected function getFieldDefinition($field_name) {
}
/**
* Returns the definitions of the fields that are candidate for display.
* Gets the definitions of the fields that are candidate for display.
*/
protected function getFieldDefinitions() {
if (!isset($this->fieldDefinitions)) {
......
......@@ -15,7 +15,7 @@
interface EntityDisplayModeInterface extends ConfigEntityInterface {
/**
* Returns the entity type this display mode is used for.
* Gets the entity type this display mode is used for.
*
* @return string
* The entity type name.
......
......@@ -129,7 +129,7 @@ protected function init(FormStateInterface $form_state) {
}
/**
* Returns the actual form array to be built.
* Gets the actual form array to be built.
*
* @see \Drupal\Core\Entity\EntityForm::processForm()
* @see \Drupal\Core\Entity\EntityForm::afterBuild()
......
......@@ -13,7 +13,7 @@
interface EntityFormBuilderInterface {
/**
* Returns the built and processed entity form for the given entity.
* Gets the built and processed entity form for the given entity.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity to be created or edited.
......
......@@ -29,7 +29,7 @@ interface EntityFormInterface extends BaseFormIdInterface {
public function setOperation($operation);
/**
* Returns the operation identifying the form.
* Gets the operation identifying the form.
*
* @return string
* The name of the operation.
......@@ -37,7 +37,7 @@ public function setOperation($operation);
public function getOperation();
/**
* Returns the form entity.
* Gets the form entity.
*
* The form entity which has been used for populating form element defaults.
*
......
......@@ -28,7 +28,7 @@ abstract class EntityHandlerBase {
protected $moduleHandler;
/**
* Returns the module handler.
* Gets the module handler.
*
* @return \Drupal\Core\Extension\ModuleHandlerInterface
* The module handler.
......
......@@ -18,7 +18,7 @@
interface EntityInterface extends AccessibleInterface, CacheableDependencyInterface {
/**
* Returns the entity UUID (Universally Unique Identifier).
* Gets the entity UUID (Universally Unique Identifier).
*
* The UUID is guaranteed to be unique and can be used to identify an entity
* across multiple systems.
......@@ -29,7 +29,7 @@ interface EntityInterface extends AccessibleInterface, CacheableDependencyInterf
public function uuid();
/**
* Returns the identifier.
* Gets the identifier.
*
* @return string|int|null
* The entity identifier, or NULL if the object does not yet have an
......@@ -38,7 +38,7 @@ public function uuid();
public function id();
/**
* Returns the language of the entity.
* Gets the language of the entity.
*
* @return \Drupal\Core\Language\LanguageInterface
* The language object.
......@@ -46,7 +46,7 @@ public function id();
public function language();
/**
* Returns whether the entity is new.
* Determines whether the entity is new.
*
* Usually an entity is new if no ID exists for it yet. However, entities may
* be enforced to be new with existing IDs too.
......@@ -75,7 +75,7 @@ public function isNew();
public function enforceIsNew($value = TRUE);
/**
* Returns the ID of the type of the entity.
* Gets the ID of the type of the entity.
*
* @return string
* The entity type ID.
......@@ -83,7 +83,7 @@ public function enforceIsNew($value = TRUE);
public function getEntityTypeId();
/**
* Returns the bundle of the entity.
* Gets the bundle of the entity.
*
* @return string
* The bundle of the entity. Defaults to the entity type ID if the entity
......@@ -92,7 +92,7 @@ public function getEntityTypeId();
public function bundle();
/**
* Returns the label of the entity.
* Gets the label of the entity.
*
* @return string|null
* The label of the entity, or NULL if there is no label defined.
......@@ -100,7 +100,7 @@ public function bundle();
public function label();
/**
* Returns the URI elements of the entity.
* Gets the URI elements of the entity.
*
* URI templates might be set in the links array in an annotation, for
* example:
......@@ -131,7 +131,7 @@ public function label();
public function urlInfo($rel = 'canonical', array $options = array());
/**
* Returns the public URL for this entity.
* Gets the public URL for this entity.
*
* @param string $rel
* The link relationship type, for example: canonical or edit-form.
......@@ -162,7 +162,7 @@ public function url($rel = 'canonical', $options = array());
public function link($text = NULL, $rel = 'canonical', array $options = []);
/**
* Returns the internal path for this entity.
* Gets the internal path for this entity.
*
* self::url() will return the full path including any prefixes, fragments, or
* query strings. This path does not include those.
......@@ -190,7 +190,7 @@ public function getSystemPath($rel = 'canonical');
public function hasLinkTemplate($key);
/**
* Returns a list of URI relationships supported by this entity.
* Gets a list of URI relationships supported by this entity.
*
* @return string[]
* An array of link relationships supported by this entity.
......@@ -341,7 +341,7 @@ public static function postLoad(EntityStorageInterface $storage, array &$entitie
public function createDuplicate();
/**
* Returns the entity type definition.
* Gets the entity type definition.
*
* @return \Drupal\Core\Entity\EntityTypeInterface
* The entity type definition.
......@@ -349,7 +349,7 @@ public function createDuplicate();
public function getEntityType();
/**
* Returns a list of entities referenced by this entity.
* Gets a list of entities referenced by this entity.
*
* @return \Drupal\Core\Entity\EntityInterface[]
* An array of entities.
......@@ -357,7 +357,7 @@ public function getEntityType();
public function referencedEntities();
/**
* Returns the original ID.
* Gets the original ID.
*
* @return int|string|null
* The original ID, or NULL if no ID was set or for entity types that do not
......@@ -377,7 +377,7 @@ public function getOriginalId();
public function setOriginalId($id);
/**
* Returns an array of all property values.
* Gets an array of all property values.
*
* @return mixed[]
* An array of property values, keyed by property name.
......@@ -385,7 +385,7 @@ public function setOriginalId($id);
public function toArray();
/**
* Returns a typed data object for this entity object.
* Gets a typed data object for this entity object.
*
* The returned typed data object wraps this entity and allows dealing with
* entities based on the generic typed data API.
......
......@@ -101,7 +101,7 @@ protected function getEntityIds() {
}
/**
* Returns the escaped label of an entity.
* Gets the escaped label of an entity.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity being listed.
......@@ -234,7 +234,7 @@ public function render() {
}
/**
* Returns the title of the page.
* Gets the title of the page.
*
* @return string
* A string title of the page.
......
......@@ -48,7 +48,7 @@ public function load();
public function getOperations(EntityInterface $entity);
/**
* Returns a listing of entities for the given entity type.
* Builds a listing of entities for the given entity type.
*
* @return array
* A render array as expected by drupal_render().
......
......@@ -913,7 +913,7 @@ public function getFormModes($entity_type_id) {
}
/**
* Returns the entity display mode info for all entity types.
* Gets the entity display mode info for all entity types.
*
* @param string $display_type
* The display type to be retrieved. It can be "view_mode" or "form_mode".
......@@ -944,7 +944,7 @@ protected function getAllDisplayModesByEntityType($display_type) {
}
/**
* Returns the entity display mode info for a specific entity type.
* Gets the entity display mode info for a specific entity type.
*
* @param string $display_type
* The display type to be retrieved. It can be "view_mode" or "form_mode".
......@@ -982,7 +982,7 @@ public function getFormModeOptions($entity_type, $include_disabled = FALSE) {
}
/**
* Returns an array of display mode options.
* Gets an array of display mode options.
*
* @param string $display_type
* The display type to be retrieved. It can be "view_mode" or "form_mode".
......
......@@ -118,7 +118,7 @@ public function getFieldStorageDefinitions($entity_type_id);
public function getLastInstalledFieldStorageDefinitions($entity_type_id);
/**
* Returns a lightweight map of fields across bundles.
* Gets a lightweight map of fields across bundles.
*
* @return array
* An array keyed by entity type. Each value is an array which keys are
......@@ -129,7 +129,7 @@ public function getLastInstalledFieldStorageDefinitions($entity_type_id);
public function getFieldMap();
/**
* Returns a lightweight map of fields across bundles filtered by field type.
* Gets a lightweight map of fields across bundles filtered by field type.
*
* @param string $field_type
* The field type to filter by.
......@@ -280,7 +280,7 @@ public function getHandler($entity_type, $handler_type);
public function createHandlerInstance($class, EntityTypeInterface $definition = null);
/**
* Get the bundle info of an entity type.
* Gets the bundle info of an entity type.
*
* @param string $entity_type
* The entity type.
......@@ -291,7 +291,7 @@ public function createHandlerInstance($class, EntityTypeInterface $definition =
public function getBundleInfo($entity_type);
/**
* Retrieves the "extra fields" for a bundle.
* Gets the "extra fields" for a bundle.
*
* @param string $entity_type_id
* The entity type ID.
......@@ -320,7 +320,7 @@ public function getBundleInfo($entity_type);
public function getExtraFields($entity_type_id, $bundle);
/**
* Returns the entity translation to be used in the given context.
* Gets the entity translation to be used in the given context.
*
* This will check whether a translation for the desired language is available
* and if not, it will fall back to the most appropriate translation based on
......@@ -350,7 +350,7 @@ public function getTranslationFromContext(EntityInterface $entity, $langcode = N
public function getDefinition($entity_type_id, $exception_on_invalid = TRUE);
/**
* Returns the entity type definition in its most recently installed state.
* Gets the entity type definition in its most recently installed state.
*
* During the application lifetime, entity type definitions can change. For
* example, updated code can be deployed. The getDefinition() method will
......@@ -389,7 +389,7 @@ public function getLastInstalledDefinition($entity_type_id);
public function getDefinitions();
/**
* Returns the entity view mode info for all entity types.
* Gets the entity view mode info for all entity types.
*
* @return array
* The view mode info for all entity types.
......@@ -397,7 +397,7 @@ public function getDefinitions();
public function getAllViewModes();
/**
* Returns the entity view mode info for a specific entity type.
* Gets the entity view mode info for a specific entity type.
*
* @param string $entity_type_id
* The entity type whose view mode info should be returned.
......@@ -408,7 +408,7 @@ public function getAllViewModes();
public function getViewModes($entity_type_id);
/**
* Returns the entity form mode info for all entity types.
* Gets the entity form mode info for all entity types.
*
* @return array
* The form mode info for all entity types.
......@@ -416,7 +416,7 @@ public function getViewModes($entity_type_id);
public function getAllFormModes();
/**
* Returns the entity form mode info for a specific entity type.
* Gets the entity form mode info for a specific entity type.
*
* @param string $entity_type_id
* The entity type whose form mode info should be returned.
......@@ -427,7 +427,7 @@ public function getAllFormModes();
public function getFormModes($entity_type_id);
/**
* Returns an array of view mode options.
* Gets an array of view mode options.
*
* @param string $entity_type_id
* The entity type whose view mode options should be returned.
......@@ -440,7 +440,7 @@ public function getFormModes($entity_type_id);
public function getViewModeOptions($entity_type_id, $include_disabled = FALSE);
/**
* Returns an array of form mode options.
* Gets an array of form mode options.
*
* @param string $entity_type_id
* The entity type whose form mode options should be returned.
......@@ -492,7 +492,7 @@ public function loadEntityByUuid($entity_type_id, $uuid);
public function loadEntityByConfigTarget($entity_type_id, $target);
/**
* Returns the entity type ID based on the class that is called on.
* Gets the entity type ID based on the class that is called on.
*
* Compares the class this is called on against the known entity classes
* and returns the entity type ID of a direct match or a subclass as fallback,
......
......@@ -23,7 +23,7 @@
interface SelectionInterface extends PluginFormInterface {
/**
* Returns a list of referenceable entities.
* Gets the list of referenceable entities.
*
* @return array
* A nested array of entities, the first level is keyed by the
......
......@@ -30,7 +30,7 @@ interface SelectionPluginManagerInterface extends PluginManagerInterface {
public function getPluginId($target_type, $base_plugin_id);
/**
* Returns selection plugins that can reference a specific entity type.
* Gets the selection plugins that can reference a specific entity type.
*
* @param string $entity_type_id
* A Drupal entity type ID.
......
......@@ -217,7 +217,7 @@ public function setRouteOptions(Route $route) {
}
/**
* Returns a list of all entity types.
* Gets the list of all entity types.
*
* @return \Drupal\Core\Entity\EntityTypeInterface[]
*/
......
......@@ -148,7 +148,7 @@ public function delete(array $entities);
public function save(EntityInterface $entity);
/**
* Returns an entity query instance.
* Gets an entity query instance.
*
* @param string $conjunction
* (optional) The logical operator for the query, either:
......@@ -163,7 +163,7 @@ public function save(EntityInterface $entity);
public function getQuery($conjunction = 'AND');
/**
* Returns an aggregated query instance.
* Gets an aggregated query instance.
*
* @param string $conjunction
* (optional) The logical operator for the query, either:
......@@ -178,7 +178,7 @@ public function getQuery($conjunction = 'AND');
public function getAggregateQuery($conjunction = 'AND');
/**
* Returns the entity type ID.
* Gets the entity type ID.
*
* @return string
* The entity type ID.
......@@ -186,7 +186,7 @@ public function getAggregateQuery($conjunction = 'AND');
public function getEntityTypeId();
/**
* Returns the entity type definition.
* Gets the entity type definition.
*
* @return \Drupal\Core\Entity\EntityTypeInterface
* Entity type definition.
......
......@@ -19,7 +19,7 @@
trait EntityTypeEventSubscriberTrait {
/**
* Returns the subscribed events.
* Gets the subscribed events.
*
* @return array
* An array of subscribed event names.
......
......@@ -51,7 +51,7 @@ public function get($property);
public function set($property, $value);
/**
* Returns the unique identifier of the entity type.
* Gets the unique identifier of the entity type.
*
* @return string
* The unique identifier of the entity type.
......@@ -59,7 +59,7 @@ public function set($property, $value);
public function id();
/**
* Returns the name of the provider of this entity type.
* Gets the name of the provider of this entity type.
*
* @return string
* The name of the provider of this entity type.
......@@ -67,7 +67,7 @@ public function id();
public function getProvider();
/**
* Returns the name of the entity type class.
* Gets the name of the entity type class.
*
* @return string
* The name of the entity type class.
......@@ -75,7 +75,7 @@ public function getProvider();
public function getClass();
/**
* Returns the name of the original entity type class.
* Gets the name of the original entity type class.
*
* In case the class name was changed with setClass(), this will return
* the initial value. Useful when trying to identify the entity type ID based
......@@ -87,7 +87,7 @@ public function getClass();
public function getOriginalClass();
/**
* Returns an array of entity keys.
* Gets an array of entity keys.
*
* @return array
* An array describing how the Field API can extract certain information
......@@ -120,7 +120,7 @@ public function getOriginalClass();
public function getKeys();
/**
* Returns a specific entity key.
* Gets a specific entity key.
*
* @param string $key
* The name of the entity key to return.
......@@ -203,7 +203,7 @@ public function hasHandlerClass($handler_type, $nested = FALSE);
public function getHandlerClass($handler_type);
/**
* Returns an array of handlers.
* Gets an array of handlers.
*
* @return array
* An associative array where the keys are the names of different handler
......@@ -233,7 +233,7 @@ public function getHandlerClass($handler_type);
public function getHandlerClasses();
/**
* Returns the storage class.
* Gets the storage class.
*
* @return string
* The class for this entity type's storage.
......@@ -251,7 +251,7 @@ public function getStorageClass();
public function setStorageClass($class);
/**
* Returns the form class for a specific operation.
* Gets the form class for a specific operation.
*
* @param string $operation
* The name of the operation to use, e.g., 'default'.
......@@ -303,7 +303,7 @@ public function hasRouteProviders();
public function getRouteProviderClasses();
/**
* Returns the list class.
* Gets the list class.
*
* @return string
* The class for this entity type's list.
......@@ -329,7 +329,7 @@ public function setListBuilderClass($class);
public function hasListBuilderClass();