You are here

public function FlexiformController::loadWithDisplay in Flexiform 7

Get flexiforms with a given display(s)

File

./flexiform.entity.inc, line 265
flexiform.entity.inc

Class

FlexiformController
The Controller for FlexiformSubmission entities

Code

public function loadWithDisplay($display) {
  $query = db_select('flexiform_display');
  $query
    ->addField('flexiform_display', 'form');
  $query
    ->condition('display', $display);
  $query
    ->groupBy('form');
  $names = $query
    ->execute()
    ->fetchCol();
  return !empty($names) ? entity_load('flexiform', $names) : array();
}