hook_update

  1. drupal
    1. drupal6 node.php
    2. drupal7
Versionen
drupal6 – drupal7 hook_update($node)

Respond to node updating.

This is a hook used by node modules. It is called to allow the module to take action when an edited node is being updated in the database by, for example, updating information in related tables.

Übergabeparameter

$node The node being updated.

Rückgabewert

None.

To take action when nodes of any type are updated (not just nodes of the type(s) defined by this module), use hook_node() instead.

For a detailed usage example, see node_example.module.

Verwandte Themen

Code

modules/node/node.api.php, line 834

<?php
function hook_update($node) {
  db_query("UPDATE {mytable} SET extra = '%s' WHERE nid = %d", 
    $node->extra, $node->nid);
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen