summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-11-13 02:00:56 +0000
committerDries Buytaert <dries@buytaert.net>2010-11-13 02:00:56 +0000
commitfee217fabc3f6a25e663fad3c7330e1427f5996c (patch)
treebf66cc485aa21493fe27eef35d329d6e6bff3aee
parenta160006defd02442cd3fa0f098094385ebb8fcf1 (diff)
downloadbrdo-fee217fabc3f6a25e663fad3c7330e1427f5996c.tar.gz
brdo-fee217fabc3f6a25e663fad3c7330e1427f5996c.tar.bz2
- Patch #970258 by Dave Reid: example documentation for hook_entity_insert()/update/delete() will cause PHP strict errors.
-rw-r--r--modules/system/system.api.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/system/system.api.php b/modules/system/system.api.php
index 11780eec7..e7a5f06b6 100644
--- a/modules/system/system.api.php
+++ b/modules/system/system.api.php
@@ -286,7 +286,7 @@ function hook_entity_load($entities, $type) {
function hook_entity_insert($entity, $type) {
// Insert the new entity into a fictional table of all entities.
$info = entity_get_info($type);
- $id = reset(entity_extract_ids($type, $entity));
+ list($id) = entity_extract_ids($type, $entity);
db_insert('example_entity')
->fields(array(
'type' => $type,
@@ -308,7 +308,7 @@ function hook_entity_insert($entity, $type) {
function hook_entity_update($entity, $type) {
// Update the entity's entry in a fictional table of all entities.
$info = entity_get_info($type);
- $id = reset(entity_extract_ids($type, $entity));
+ list($id) = entity_extract_ids($type, $entity);
db_update('example_entity')
->fields(array(
'updated' => REQUEST_TIME,
@@ -329,7 +329,7 @@ function hook_entity_update($entity, $type) {
function hook_entity_delete($entity, $type) {
// Delete the entity's entry from a fictional table of all entities.
$info = entity_get_info($type);
- $id = reset(entity_extract_ids($type, $entity));
+ list($id) = entity_extract_ids($type, $entity);
db_delete('example_entity')
->condition('type', $type)
->condition('id', $id)