You are here

function noderelationships_settings_list in Node Relationships 6

Get a list of relationship settings matching the given conditions.

Parameters

$where: Expression for the WHERE clause of the query.

$args: A variable list of arguments for the query.

3 calls to noderelationships_settings_list()
noderelationships_settings_delete_nodereference in ./noderelationships.inc
Delete relationship settings when a nodereference field has been deleted.
noderelationships_settings_load in ./noderelationships.inc
Get relationship settings for the given content type.
_noderelationships_nodereference_settings_form_submit in ./noderelationships.admin.inc
Submit handler for nodereference field settings form.

File

./noderelationships.inc, line 27
Common functions for the noderelationships module.

Code

function noderelationships_settings_list($where) {
  $args = func_get_args();
  array_shift($args);

  // Check for 'All arguments in one array' syntax.
  if (isset($args[0]) && is_array($args[0])) {
    $args = $args[0];
  }
  $result = db_query('SELECT type_name, relation_type, related_type, field_name, settings FROM {noderelationships_settings} WHERE ' . $where, $args);
  $rows = array();
  while ($row = db_fetch_object($result)) {
    $row->settings = !empty($row->settings) ? (array) unserialize($row->settings) : array();
    $rows[] = $row;
  }
  return $rows;
}