You are here

public function SerialFields::getInstances in Serial Field 7

Get field instances.

Return value

array[] Field instances.

File

tests/serial.fields.inc, line 147
Serial (Fields Helper).

Class

SerialFields
Class SerialFields.

Code

public function &getInstances() {
  if (empty($this->instances)) {
    $query = db_select('field_config_instance', 'fci')
      ->fields('fci', array(
      'field_name',
      'data',
    ))
      ->condition('field_name', array_keys($this->fields))
      ->execute()
      ->fetchAllKeyed();
    $this->instances = array_map('unserialize', $query);
  }
  return $this->instances;
}