You are here

function node_gallery_api_get_item_field_name in Node Gallery 7

Get the gallery ref field name for a set of types.

Parameters

string $gallery_type: Gallery type

string $item_type: Item type

int $relationship_type_id: Relationship ID

Return value

bool|string Name of the ref field, or FALSE is there is not one.

9 calls to node_gallery_api_get_item_field_name()
node_gallery_api_create_item_from_file in ./node_gallery_api.pages.inc
Create item from file. Form Plupload.
node_gallery_api_create_new_gallery_submit in ./node_gallery_api.module
If the user selected the option to create a new gallery, create a stub gallery, assign the images to that gallery, and redirect them to the gallery edit form.
node_gallery_api_entity_delete in ./node_gallery_api.module
Implements hook_entity_delete().
node_gallery_api_entity_update in ./node_gallery_api.module
Implements hook_entity_update().
node_gallery_api_field_information in ./node_gallery_api.module
Field information.

... See full list

File

./node_gallery_api.inc, line 387
Node Gallery API function

Code

function node_gallery_api_get_item_field_name($gallery_type = NULL, $item_type = NULL, $relationship_type_id = NULL) {
  if (empty($relationship_type_id)) {
    $relationship_type = node_gallery_api_get_relationship_type($gallery_type, $item_type);
    $relationship_type_id = $relationship_type->id;
  }
  if (!empty($relationship_type_id)) {
    return NODE_GALLERY_REF_FIELD . '_' . $relationship_type_id;
  }
  return FALSE;
}