You are here

public function SerialFields::saveInstances in Serial Field 7

Save field instances.

Return value

self Object instance.

Throws

\Exception

\InvalidMergeQueryException

File

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

Class

SerialFields
Class SerialFields.

Code

public function saveInstances() {
  foreach ($this->instances as $field_name => $data) {
    db_merge('field_config_instance')
      ->fields(array(
      'data' => serialize($data),
    ))
      ->condition('field_name', $field_name)
      ->execute();
  }
  return $this;
}