You are here

public function YamlFormSubmissionStorage::getMaxSerial in YAML Form 8

Returns a form's max serial number.

Parameters

\Drupal\yamlform\YamlFormInterface $yamlform: A form.

Return value

int The next serial number.

Overrides YamlFormSubmissionStorageInterface::getMaxSerial

1 call to YamlFormSubmissionStorage::getMaxSerial()
YamlFormSubmissionStorage::getNextSerial in src/YamlFormSubmissionStorage.php
Returns the next serial number.

File

src/YamlFormSubmissionStorage.php, line 574

Class

YamlFormSubmissionStorage
Defines the form submission storage.

Namespace

Drupal\yamlform

Code

public function getMaxSerial(YamlFormInterface $yamlform) {
  $query = db_select('yamlform_submission');
  $query
    ->condition('yamlform_id', $yamlform
    ->id());
  $query
    ->addExpression('MAX(serial)');
  return $query
    ->execute()
    ->fetchField() + 1;
}