You are here

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

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

Loads all fields from a specific pane type

@access private @static

Parameters

string $pane_type:

Return value

void

Throws

UCXF_DbException

1 call to UCXF_FieldList::loadAllFromPane()
UCXF_FieldList::getFieldsFromPane in class/UCXF_FieldList.class.php
Get all fields from a particular pane type

File

class/UCXF_FieldList.class.php, line 267
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 loadAllFromPane($pane_type) {

  // Reasons to skip out early
  if (self::$allLoaded) {
    return;
  }
  if (isset(self::$loadedPanes[$pane_type])) {
    return;
  }
  $result = db_select('uc_extra_fields')
    ->condition('pane_type', '%' . $pane_type . '%', 'LIKE')
    ->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 fields for this pane are loaded
  self::$loadedPanes[$pane_type] = TRUE;
  self::dbResultToField($result);
}