You are here

public static function UCXF_FieldList::createField in Extra Fields Checkout Pane 6.2

Same name and namespace in other branches
  1. 7 class/UCXF_FieldList.class.php \UCXF_FieldList::createField()

Create a field based on pane type

@access public @static

Parameters

string $pane_type:

Return value

UCXF_Field

5 calls to UCXF_FieldList::createField()
UCXFApiTestCase::createFieldThroughAPI in ./uc_extra_fields_pane.test
Creates a field through the API and sets default values.
UCXF_FieldList::dbResultToField in class/UCXF_FieldList.class.php
Creates UCXF_Field objects from a database resource.
uc_extra_fields_pane_field_features_rebuild in ./uc_extra_fields_pane.features.inc
Implementation of hook_features_rebuild().
uc_extra_fields_pane_token_list in ./uc_extra_fields_pane.module
Implementation of hook_token_list().
uc_extra_fields_pane_token_values in ./uc_extra_fields_pane.module
Implementation of hook_token_values().

File

class/UCXF_FieldList.class.php, line 59
Contains the UCXF_FieldList class.

Class

UCXF_FieldList
This class is used to keep track of all loaded fields in one request. It's also used as a central place to request fields.

Code

public static function createField($pane_type) {
  $pane_types = explode('|', $pane_type);
  if (in_array('extra_delivery', $pane_types) || in_array('extra_billing', $pane_types)) {
    $field = new UCXF_AddressField();
  }
  else {
    $field = new UCXF_CustomField();
  }
  return $field;
}