diff --git a/includes/common.inc b/includes/common.inc index a3c8676..9db6574 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -7431,12 +7431,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; @@ -7524,12 +7524,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); @@ -7562,13 +7563,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(); @@ -7598,11 +7598,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 @@ -7620,6 +7615,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) { @@ -7639,7 +7639,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. @@ -7676,7 +7676,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'. @@ -7685,6 +7684,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)) { @@ -7815,7 +7816,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 @@ -7828,7 +7829,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 ae78077..4c05bfa 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. * @@ -953,7 +955,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 @@ -981,10 +983,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. @@ -1261,7 +1264,7 @@ class EntityFieldQuery { } /** - * Get the total number of results and initialize a pager for the query. + * Gets the total number of results and initialize 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. @@ -1348,6 +1351,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 { } diff --git a/modules/simpletest/tests/entity_crud_hook_test.module b/modules/simpletest/tests/entity_crud_hook_test.module index 873a162..d25dff1 100644 --- a/modules/simpletest/tests/entity_crud_hook_test.module +++ b/modules/simpletest/tests/entity_crud_hook_test.module @@ -1,8 +1,9 @@