function hook_chado_node_sync_create_new_node

2.x tripal_core.chado_nodes.api.inc hook_chado_node_sync_create_new_node($new_node, $record)
3.x tripal_core.chado_nodes.api.inc hook_chado_node_sync_create_new_node($new_node, $record)

Create New Node

Note: For your own module, replace hook in the function name with the machine-name of your chado node type (ie: chado_feature).

Parameters

$new_node:: a basic new node object

$record:: the record object from chado specifying the biological data for this node

Return value

A node object containing all the fields necessary to create a new node during sync

Related topics

1 function implements hook_chado_node_sync_create_new_node()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

chado_stock_chado_node_sync_create_new_node in tripal_stock/includes/tripal_stock.chado_node.inc
Used by Tripal Chado Node API during sync'ing of nodes

File

tripal_core/api/tripal_core.chado_nodes.api.inc, line 1214
API to handle much of the common functionality implemented when creating a drupal node type.

Code

function hook_chado_node_sync_create_new_node($new_node, $record) {

  // Add relevant chado details to the new node object. This really only
  // needs to be the fields from the node used during node creation
  // including values used to generate the title, etc. All additional chado
  // data will be added via nodetype_load when the node is later used
  $new_node->uniquename = $record->uniquename;

  return $new_node;
}