diff --git a/core/modules/comment/comment.entity.inc b/core/modules/comment/comment.entity.inc index 62a23d9..9df0470 100644 --- a/core/modules/comment/comment.entity.inc +++ b/core/modules/comment/comment.entity.inc @@ -101,7 +101,7 @@ class CommentStorageController extends EntityDatabaseStorageController { * Overrides EntityDatabaseStorageController::attachLoad(). */ protected function attachLoad(&$comments, $revision_id = FALSE) { - // Setup standard comment properties. + // Set up standard comment properties. foreach ($comments as $key => $comment) { $comment->name = $comment->uid ? $comment->registered_name : $comment->name; $comment->new = node_mark($comment->nid, $comment->changed); @@ -141,7 +141,7 @@ class CommentStorageController extends EntityDatabaseStorageController { // Strip the "/" from the end of the thread. $max = rtrim($max, '/'); // Finally, build the thread field for this new comment. - $thread = comment_int_to_alphadecimal(comment_alphadecimal_to_int($max) + 1) . '/'; + $thread = comment_increment_alphadecimal($max) . '/'; } else { // This is a comment with a parent comment, so increase the part of @@ -169,7 +169,7 @@ class CommentStorageController extends EntityDatabaseStorageController { $parent_depth = count(explode('.', $parent->thread)); $last = $parts[$parent_depth]; // Finally, build the thread field for this new comment. - $thread = $parent->thread . '.' . comment_int_to_alphadecimal(comment_alphadecimal_to_int($last) + 1) . '/'; + $thread = $parent->thread . '.' . comment_increment_alphadecimal($last) . '/'; } } if (empty($comment->created)) { @@ -218,13 +218,15 @@ class CommentStorageController extends EntityDatabaseStorageController { /** * Updates the comment statistics for a given node. * - * The following fields are contained in the node_comment_statistics table. - * - last_comment_timestamp: the timestamp of the last comment for this node - * or the node create stamp if no comments exist for the node. - * - last_comment_name: the name of the anonymous poster for the last comment - * - last_comment_uid: the uid of the poster for the last comment for this - * node or the node authors uid if no comments exists for the node. - * - comment_count: the total number of approved/published comments on this + * The {node_comment_statistics} table has the following fields: + * - last_comment_timestamp: The timestamp of the last comment for this node, + * or the node created timestamp if no comments exist for the node. + * - last_comment_name: The name of the anonymous poster for the last + * comment. + * - last_comment_uid: The user ID of the poster for the last comment for + * this node, or the node author's user ID if no comments exists for the + * node. + * - comment_count: The total number of approved/published comments on this * node. * * @param $nid diff --git a/core/modules/entity/entity.controller.inc b/core/modules/entity/entity.controller.inc index 2498ab4..2c21c28 100644 --- a/core/modules/entity/entity.controller.inc +++ b/core/modules/entity/entity.controller.inc @@ -202,8 +202,8 @@ class DrupalDefaultEntityController implements DrupalEntityControllerInterface { $query_result = $this->buildQuery($ids, $conditions, $revision_id)->execute(); if (!empty($this->entityInfo['entity class'])) { - // Let PDO create objects of the specified entity class, for which we - // have to provide necessary arguments for constructing the objects. + // We provide the necessary arguments for PDO to create objects of the + // specified entity class. // @see EntityInterface::__construct() $query_result->setFetchMode(PDO::FETCH_CLASS, $this->entityInfo['entity class'], array(array(), $this->entityType)); } @@ -440,7 +440,7 @@ class EntityDatabaseStorageController extends DrupalDefaultEntityController impl public function delete($ids) { $entities = $ids ? $this->load($ids) : FALSE; if (!$entities) { - // Do nothing, in case invalid or no ids have been passed. + // If no IDs or invalid IDs were passed, do nothing. return; } $transaction = db_transaction(); @@ -479,8 +479,8 @@ class EntityDatabaseStorageController extends DrupalDefaultEntityController impl try { // Load the stored entity, if any. if (!$entity->isNew() && !isset($entity->original)) { - // In order to properly work in case of name changes, load the original - // entity using the id key if it is available. + // The entity's machine name may have changed, so load the original + // entity using the ID key if it is available. $entity->original = entity_load_unchanged($this->entityType, $entity->id()); } @@ -556,7 +556,7 @@ class EntityDatabaseStorageController extends DrupalDefaultEntityController impl } // Invoke the hook. module_invoke_all($this->entityType . '_' . $hook, $entity); - // Invoke the respective entity level hook. + // Invoke the respective entity-level hook. module_invoke_all('entity_' . $hook, $entity, $this->entityType); } } diff --git a/core/modules/entity/entity.module b/core/modules/entity/entity.module index 4ac83ff..2eda87c 100644 --- a/core/modules/entity/entity.module +++ b/core/modules/entity/entity.module @@ -185,7 +185,7 @@ function entity_create_stub_entity($entity_type, $ids) { if (!empty($info['entity keys']['bundle']) && isset($ids[2])) { $values[$info['entity keys']['bundle']] = $ids[2]; } - // @todo: Once all entities are converted, just rely on entity_create(). + // @todo Once all entities are converted, just rely on entity_create(). return isset($info['entity class']) ? entity_create($entity_type, $values) : (object) $values; } diff --git a/core/modules/entity/tests/entity_test.module b/core/modules/entity/tests/entity_test.module index 4d34232..2ce4ec7 100644 --- a/core/modules/entity/tests/entity_test.module +++ b/core/modules/entity/tests/entity_test.module @@ -25,15 +25,15 @@ function entity_test_entity_info() { } /** - * Loads a test-entity. + * Loads a test entity. * * @param $id - * A test-entity ID. + * A test entity ID. * @param $reset * A boolean indicating that the internal cache should be reset. * * @return Entity - * The loaded entity object or FALSE. + * The loaded entity object, or FALSE on failure. */ function entity_test_load($id, $reset = FALSE) { $result = entity_load('entity_test', array($id), array(), $reset);