summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhalcyonCorsair2012-03-07 02:34:54 (GMT)
committerhalcyonCorsair2012-03-07 02:34:54 (GMT)
commitaef449df16add7fd936f1b4947e31b126279538e (patch)
treed803a875787ae73594b58cae473a558bda4dad8d
parentb6853717375318164e1ef948442f66572fd74126 (diff)
Update comments in and around expire_get_node_references().7.x-1.0-alpha2
-rw-r--r--expire.node_reference.inc12
1 files changed, 10 insertions, 2 deletions
diff --git a/expire.node_reference.inc b/expire.node_reference.inc
index 8f6592e..50c1e48 100644
--- a/expire.node_reference.inc
+++ b/expire.node_reference.inc
@@ -1,12 +1,20 @@
<?php
+/**
+ * Get a list of nodes linked to the passed node via node_reference.
+ *
+ * @param $node
+ * node object
+ *
+ * @return $paths
+ * an array of node paths
+ */
function expire_get_node_references($node) {
$paths = array();
$fields= field_info_instances('node', $node->type);
$field_types = field_info_fields();
+ // Loop over the fields of this node. If the field is a node_reference field, add any referenced nodes to $paths
foreach ($fields as $field) {
- // Add referenced node paths and expire referenced nodes
- // when the referencing node is updated.
if ($field_types[$field['field_name']]['type'] == 'node_reference') {
$node_field = isset($node->$field['field_name']) && !empty($node->$field['field_name']) ? $node->$field['field_name'] : array();
foreach($node_field[LANGUAGE_NONE] as $reference) {