public static function getInstance() { if (!is_object(self::$instance)) { self::$instance = new self(); } return self::$instance; }
public static function getSelectableBase() { if (!self::$sbase) { require_once 'selectable/base.php'; self::$sbase = J2StoreSelectableBase::getInstance(); } return self::$sbase; }
public static function getSelectableBase() { return J2StoreSelectableBase::getInstance(); }
function save() { $selectableBase = new J2StoreSelectableBase(); $result = $selectableBase->save(); if ($result) { //get process field because result is true $data = $selectableBase->fielddata; $table = $this->getTable(); $table->bind($data); $table->store(); return $table->field_id; } else { //error get it $errors = $selectableBase->errors; $error = implode(',', $errors); throw new Exception($error); return false; } }