You are here

private static function UCXF_FieldList::loadAll in Extra Fields Checkout Pane 7

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

Loads all fields @access private @static

Return value

void

Throws

UCXF_DbException

1 call to UCXF_FieldList::loadAll()
UCXF_FieldList::getAllFields in class/UCXF_FieldList.class.php
Get all available fields @access public @static

File

class/UCXF_FieldList.class.php, line 298
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

private static function loadAll() {

  // Reasons to skip out early
  if (self::$allLoaded) {
    return;
  }
  $result = db_select('uc_extra_fields')
    ->fields('uc_extra_fields')
    ->orderBy('weight')
    ->execute();
  if ($result === FALSE) {
    throw new UCXF_DbException(t('Failed to read from database table uc_extra_fields'));
  }

  // Set flag that all fields are loaded
  self::$allLoaded = TRUE;
  self::dbResultToField($result);
}