You are here

function flexiform_get_flexiforms in Flexiform 7

Gets an array of all flexiforms, keyed by the type name.

Parameters

$type_name: If set, the type with the given name is returned.

Return value

Flexiform[] Depending whether $type isset, an array of flexiforms or a single one.

1 call to flexiform_get_flexiforms()
flexiform_load in ./flexiform.module
Menu argument loader; Load a flexiform by string.
1 string reference to 'flexiform_get_flexiforms'
flexiform_form in ./flexiform.admin.inc
Generates the model type editing form.

File

./flexiform.module, line 252
Module for the Flexiform system.

Code

function flexiform_get_flexiforms($flexiform_name = NULL) {

  // entity_load will get the Entity controller for our flexiform_submission entity and call the load
  // function of that object - we are loading entities by name here.
  $flexiforms = entity_load_multiple_by_name('flexiform', isset($flexiform_name) ? array(
    $flexiform_name,
  ) : FALSE);
  return isset($flexiform_name) ? reset($flexiforms) : $flexiforms;
}