summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorJennifer Hodgdon <yahgrp@poplarware.com>2012-08-03 10:59:07 -0700
committerJennifer Hodgdon <yahgrp@poplarware.com>2012-08-03 10:59:07 -0700
commitf4aa23a2ccddb6a4330cd7a81fea2d70a6da7b96 (patch)
treefc834a1ced08f26f50ffa9605aba89de293eb533 /includes
parented2c39e2755ec00a7659710487812f173cd5236a (diff)
downloadbrdo-f4aa23a2ccddb6a4330cd7a81fea2d70a6da7b96.tar.gz
brdo-f4aa23a2ccddb6a4330cd7a81fea2d70a6da7b96.tar.bz2
Issue #1315340 by Albert Volkman, aspilicious: API docs cleanup for entity includes and tests
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc41
-rw-r--r--includes/entity.inc13
2 files changed, 29 insertions, 25 deletions
diff --git a/includes/common.inc b/includes/common.inc
index f80496bf8..401c053f3 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -7449,12 +7449,12 @@ function drupal_check_incompatibility($v, $current_version) {
/**
* Get the entity info array of an entity type.
*
- * @see hook_entity_info()
- * @see hook_entity_info_alter()
- *
* @param $entity_type
* The entity type, e.g. node, for which the info shall be returned, or NULL
* to return an array with info about all types.
+ *
+ * @see hook_entity_info()
+ * @see hook_entity_info_alter()
*/
function entity_get_info($entity_type = NULL) {
global $language;
@@ -7542,12 +7542,13 @@ function entity_info_cache_clear() {
* The entity type; e.g. 'node' or 'user'.
* @param $entity
* The entity from which to extract values.
+ *
* @return
* A numerically indexed array (not a hash table) containing these
* elements:
- * 0: primary id of the entity
- * 1: revision id of the entity, or NULL if $entity_type is not versioned
- * 2: bundle name of the entity
+ * - 0: Primary ID of the entity.
+ * - 1: Revision ID of the entity, or NULL if $entity_type is not versioned.
+ * - 2: Bundle name of the entity, or NULL if $entity_type has no bundles.
*/
function entity_extract_ids($entity_type, $entity) {
$info = entity_get_info($entity_type);
@@ -7580,13 +7581,12 @@ function entity_extract_ids($entity_type, $entity) {
* @param $entity_type
* The entity type; e.g. 'node' or 'user'.
* @param $ids
- * A numerically indexed array, as returned by entity_extract_ids(),
- * containing these elements:
- * 0: primary id of the entity
- * 1: revision id of the entity, or NULL if $entity_type is not versioned
- * 2: bundle name of the entity, or NULL if $entity_type has no bundles
+ * A numerically indexed array, as returned by entity_extract_ids().
+ *
* @return
* An entity structure, initialized with the ids provided.
+ *
+ * @see entity_extract_ids()
*/
function entity_create_stub_entity($entity_type, $ids) {
$entity = new stdClass();
@@ -7616,11 +7616,6 @@ function entity_create_stub_entity($entity_type, $ids) {
* DrupalDefaultEntityController class. See node_entity_info() and the
* NodeController in node.module as an example.
*
- * @see hook_entity_info()
- * @see DrupalEntityControllerInterface
- * @see DrupalDefaultEntityController
- * @see EntityFieldQuery
- *
* @param $entity_type
* The entity type to load, e.g. node or user.
* @param $ids
@@ -7638,6 +7633,11 @@ function entity_create_stub_entity($entity_type, $ids) {
* found, an empty array is returned.
*
* @todo Remove $conditions in Drupal 8.
+ *
+ * @see hook_entity_info()
+ * @see DrupalEntityControllerInterface
+ * @see DrupalDefaultEntityController
+ * @see EntityFieldQuery
*/
function entity_load($entity_type, $ids = FALSE, $conditions = array(), $reset = FALSE) {
if ($reset) {
@@ -7657,7 +7657,7 @@ function entity_load($entity_type, $ids = FALSE, $conditions = array(), $reset =
* @param $entity_type
* The entity type to load, e.g. node or user.
* @param $id
- * The id of the entity to load.
+ * The ID of the entity to load.
*
* @return
* The unchanged entity, or FALSE if the entity cannot be loaded.
@@ -7694,7 +7694,6 @@ function entity_get_controller($entity_type) {
* recursion. By convention, entity_prepare_view() is called after
* field_attach_prepare_view() to allow entity level hooks to act on content
* loaded by field API.
- * @see hook_entity_prepare_view()
*
* @param $entity_type
* The type of entity, i.e. 'node', 'user'.
@@ -7703,6 +7702,8 @@ function entity_get_controller($entity_type) {
* @param $langcode
* (optional) A language code to be used for rendering. Defaults to the global
* content language of the current request.
+ *
+ * @see hook_entity_prepare_view()
*/
function entity_prepare_view($entity_type, $entities, $langcode = NULL) {
if (!isset($langcode)) {
@@ -7833,7 +7834,7 @@ function entity_language($entity_type, $entity) {
}
/**
- * Helper function for attaching field API validation to entity forms.
+ * Attaches field API validation to entity forms.
*/
function entity_form_field_validate($entity_type, $form, &$form_state) {
// All field attach API functions act on an entity object, but during form
@@ -7846,7 +7847,7 @@ function entity_form_field_validate($entity_type, $form, &$form_state) {
}
/**
- * Helper function for copying submitted values to entity properties for simple entity forms.
+ * Copies submitted values to entity properties for simple entity forms.
*
* During the submission handling of an entity form's "Save", "Preview", and
* possibly other buttons, the form state's entity needs to be updated with the
diff --git a/includes/entity.inc b/includes/entity.inc
index e7356029a..b19a23b58 100644
--- a/includes/entity.inc
+++ b/includes/entity.inc
@@ -296,6 +296,7 @@ class DrupalDefaultEntityController implements DrupalEntityControllerInterface {
/**
* Attaches data to entities upon loading.
+ *
* This will attach fields, if the entity is fieldable. It calls
* hook_entity_load() for modules which need to add data to all entities.
* It also calls hook_TYPE_load() on the loaded entities. For example
@@ -422,6 +423,7 @@ class EntityFieldQueryException extends Exception {}
* other storage engines might not do this.
*/
class EntityFieldQuery {
+
/**
* Indicates that both deleted and non-deleted fields should be returned.
*
@@ -958,7 +960,7 @@ class EntityFieldQuery {
}
/**
- * Enable a pager for the query.
+ * Enables a pager for the query.
*
* @param $limit
* An integer specifying the number of elements per page. If passed a false
@@ -986,10 +988,11 @@ class EntityFieldQuery {
}
/**
- * Enable sortable tables for this query.
+ * Enables sortable tables for this query.
*
* @param $headers
- * An EFQ Header array based on which the order clause is added to the query.
+ * An EFQ Header array based on which the order clause is added to the
+ * query.
*
* @return EntityFieldQuery
* The called object.
@@ -1272,7 +1275,7 @@ class EntityFieldQuery {
}
/**
- * Get the total number of results and initialize a pager for the query.
+ * Gets the total number of results and initializes a pager for the query.
*
* The pager can be disabled by either setting the pager limit to 0, or by
* setting this query to be a count query.
@@ -1359,6 +1362,6 @@ class EntityFieldQuery {
}
/**
- * Exception thrown when a malformed entity is passed.
+ * Defines an exception thrown when a malformed entity is passed.
*/
class EntityMalformedException extends Exception { }