You are here

public static function UCXF_FieldList::getFieldByID in Extra Fields Checkout Pane 7

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

Get a single field by ID

@access public @static

Parameters

int $field_id:

Return value

UCXF_Field

2 calls to UCXF_FieldList::getFieldByID()
UCXFApiTestCase::testUCXF_FieldList in ./uc_extra_fields_pane.test
Test if UCXF_FieldList behaves as excepted.
uc_extra_fields_pane_field_load in ./uc_extra_fields_pane.module
Implements hook_load().

File

class/UCXF_FieldList.class.php, line 96
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 getFieldByID($field_id) {
  self::loadOne(self::BY_ID, $field_id);
  if (isset(self::$fields[$field_id])) {
    return self::$fields[$field_id];
  }
}