'not null' => TRUE,
'default' => 0,
),
- // This assumes that the node won't have his author changed,
- // which might be reasonable depending on the application.
'owner' => array(
'description' => t('The {user}.owner owner of an item.'),
'type' => 'int',
'api' => 3,
);
}
+
+/**
+ * Implements hook_node_update()
+ */
+function muamba_node_update($node) {
+ if ($node->type == MUAMBA_NODE_TYPE) {
+ db_update('muamba')
+ ->fields(array('owner' => $node->uid)
+ ->condition('nid', $node->nid)
+ ->execute();
+ }
+}