You are here

function formdefaults_getform in Form Defaults 8

Same name and namespace in other branches
  1. 5.3 formdefaults.module \formdefaults_getform()
  2. 5 formdefaults.module \formdefaults_getform()
  3. 5.2 formdefaults.module \formdefaults_getform()
  4. 6.2 formdefaults.module \formdefaults_getform()
  5. 6 formdefaults.module \formdefaults_getform()
  6. 7 formdefaults.module \formdefaults_getform()

Retrieve from alterations from the database @formid the form id to retrieve.

6 calls to formdefaults_getform()
EditFieldForm::buildForm in src/Form/EditFieldForm.php
Form constructor.
EditFieldForm::submitForm in src/Form/EditFieldForm.php
Form submission handler.
EditForm::buildForm in src/Form/EditForm.php
Form constructor.
EditForm::submitForm in src/Form/EditForm.php
Form submission handler.
FormDefaultsHelper::saveForm in src/Helper/FormDefaultsHelper.php

... See full list

File

./formdefaults.module, line 255

Code

function formdefaults_getform($formid) {
  $result = Database::getConnection()
    ->query('SELECT * FROM {formdefaults_forms} WHERE formid = :formid', [
    ':formid' => $formid,
  ]);
  $formarray = array();
  foreach ($result as $form) {
    $formarray = unserialize($form->formdata);
  }
  return $formarray;
}