You are here

public function FormAssemblyEntityController::loadPropertySet in FormAssembly 7

Returns the entity id and value of a property for all fa_form entities.

Parameters

string $property: The name of the entity property.

Return value

DatabaseStatementInterface|null If the property exists the query results are returned.

File

includes/FormAssemblyEntityController.php, line 127
Provides a controller building upon the Entity API but with some additional display and search.

Class

FormAssemblyEntityController
@file Provides a controller building upon the Entity API but with some additional display and search.

Code

public function loadPropertySet($property) {
  $info = entity_get_property_info('fa_form');
  if (array_key_exists($property, $info['properties'])) {
    $query = db_select('formassembly', 'fa');
    $query
      ->fields('fa', array(
      'eid',
      $property,
    ));
    $stored = $query
      ->execute();
    return $stored;
  }
  else {
    watchdog('FormAssembly', 'Failed to load Property Set. @property: Not a valid property of fa_form', 'error', array(
      '@property' => $property,
    ), WATCHDOG_ERROR);
    return NULL;
  }
}