You are here

protected function LdapQueryAdmin::populateFromDrupalForm in Lightweight Directory Access Protocol (LDAP) 7.2

Same name and namespace in other branches
  1. 8.2 ldap_query/LdapQueryAdmin.class.php \LdapQueryAdmin::populateFromDrupalForm()
  2. 7 ldap_query/LdapQueryAdmin.class.php \LdapQueryAdmin::populateFromDrupalForm()
2 calls to LdapQueryAdmin::populateFromDrupalForm()
LdapQueryAdmin::drupalFormSubmit in ldap_query/LdapQueryAdmin.class.php
LdapQueryAdmin::drupalFormValidate in ldap_query/LdapQueryAdmin.class.php

File

ldap_query/LdapQueryAdmin.class.php, line 62

Class

LdapQueryAdmin

Code

protected function populateFromDrupalForm($op, $values) {
  foreach ($this
    ->fields() as $field_id => $field) {
    if (isset($field['form']) && property_exists('LdapQueryAdmin', $field['property_name'])) {
      $value = $values[$field_id];
      if (isset($field['form_to_prop_functions'])) {
        foreach ($field['form_to_prop_functions'] as $function) {
          $value = call_user_func($function, $value);
        }
      }
      $this->{$field['property_name']} = $value;
    }
  }
  $this->inDatabase = $op == 'edit';
}