Commit 9040de60 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Exception: UserException renamed to UserFormException. New Class UserReportException created.

parent 038400fe
...@@ -21,7 +21,7 @@ class QfqController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController { ...@@ -21,7 +21,7 @@ class QfqController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
$qfq = new \qfq\QuickFormQuery($contentObject->data); $qfq = new \qfq\QuickFormQuery($contentObject->data);
$html = $qfq->process(); $html = $qfq->process();
} catch (qfq\UserException $e) { } catch (qfq\UserFormException $e) {
$html = $e->formatMessage(); $html = $e->formatMessage();
} catch (qfq\CodeException $e) { } catch (qfq\CodeException $e) {
$html = $e->formatMessage(); $html = $e->formatMessage();
......
...@@ -60,7 +60,7 @@ try { ...@@ -60,7 +60,7 @@ try {
$answer[API_REDIRECT] = API_ANSWER_REDIRECT_CLIENT; $answer[API_REDIRECT] = API_ANSWER_REDIRECT_CLIENT;
$answer[API_STATUS] = API_ANSWER_STATUS_SUCCESS; $answer[API_STATUS] = API_ANSWER_STATUS_SUCCESS;
} catch (qfq\UserException $e) { } catch (qfq\UserFormException $e) {
$answer[API_MESSAGE] = $e->formatMessage(); $answer[API_MESSAGE] = $e->formatMessage();
} catch (qfq\CodeException $e) { } catch (qfq\CodeException $e) {
$answer[API_MESSAGE] = $e->formatMessage(); $answer[API_MESSAGE] = $e->formatMessage();
......
...@@ -66,7 +66,7 @@ try { ...@@ -66,7 +66,7 @@ try {
$answer[API_MESSAGE] = 'load: success'; $answer[API_MESSAGE] = 'load: success';
$answer[API_FORM_UPDATE] = $data; $answer[API_FORM_UPDATE] = $data;
} catch (qfq\UserException $e) { } catch (qfq\UserFormException $e) {
$answer[API_MESSAGE] = $e->formatMessage(); $answer[API_MESSAGE] = $e->formatMessage();
$val = Store::getVar(SYSTEM_FORM_ELEMENT, STORE_SYSTEM); $val = Store::getVar(SYSTEM_FORM_ELEMENT, STORE_SYSTEM);
......
...@@ -64,7 +64,7 @@ try { ...@@ -64,7 +64,7 @@ try {
$answer[API_STATUS] = API_ANSWER_STATUS_SUCCESS; $answer[API_STATUS] = API_ANSWER_STATUS_SUCCESS;
$answer[API_MESSAGE] = 'save: success'; $answer[API_MESSAGE] = 'save: success';
} catch (qfq\UserException $e) { } catch (qfq\UserFormException $e) {
$answer[API_MESSAGE] = $e->formatMessage(); $answer[API_MESSAGE] = $e->formatMessage();
$val = Store::getVar(SYSTEM_FORM_ELEMENT, STORE_SYSTEM); $val = Store::getVar(SYSTEM_FORM_ELEMENT, STORE_SYSTEM);
......
...@@ -9,7 +9,7 @@ namespace qfq; ...@@ -9,7 +9,7 @@ namespace qfq;
use qfq; use qfq;
use qfq\Store; use qfq\Store;
use qfq\UserException; use qfq\UserFormException;
use qfq\OnArray; use qfq\OnArray;
require_once(__DIR__ . '/../qfq/store/Store.php'); require_once(__DIR__ . '/../qfq/store/Store.php');
...@@ -116,7 +116,7 @@ abstract class AbstractBuildForm { ...@@ -116,7 +116,7 @@ abstract class AbstractBuildForm {
* @return string|array $mode=LOAD_FORM: The whole form as HTML, $mode=FORM_UPDATE: array of all formElement.dynamicUpdate-yes values/states * @return string|array $mode=LOAD_FORM: The whole form as HTML, $mode=FORM_UPDATE: array of all formElement.dynamicUpdate-yes values/states
* @throws CodeException * @throws CodeException
* @throws DbException * @throws DbException
* @throws \qfq\UserException * @throws \qfq\UserFormException
*/ */
public function process($mode) { public function process($mode) {
$htmlHead = ''; $htmlHead = '';
...@@ -297,7 +297,7 @@ abstract class AbstractBuildForm { ...@@ -297,7 +297,7 @@ abstract class AbstractBuildForm {
* @return string * @return string
* @throws CodeException * @throws CodeException
* @throws DbException * @throws DbException
* @throws \qfq\UserException * @throws \qfq\UserFormException
*/ */
public function elements($recordId, $filter = FORM_ELEMENTS_NATIVE, $feIdContainer = 0, &$json) { public function elements($recordId, $filter = FORM_ELEMENTS_NATIVE, $feIdContainer = 0, &$json) {
$html = ''; $html = '';
...@@ -375,7 +375,7 @@ abstract class AbstractBuildForm { ...@@ -375,7 +375,7 @@ abstract class AbstractBuildForm {
* Takes the current SIP ('form' and additional parameter), set SIP_RECORD_ID=0 and create a new 'NewRecordUrl'. * Takes the current SIP ('form' and additional parameter), set SIP_RECORD_ID=0 and create a new 'NewRecordUrl'.
* *
* @throws CodeException * @throws CodeException
* @throws \qfq\UserException * @throws \qfq\UserFormException
*/ */
public function deriveNewRecordUrlFromExistingSip(&$toolTipNew) { public function deriveNewRecordUrlFromExistingSip(&$toolTipNew) {
$urlParam = $this->store->getStore(STORE_SIP); $urlParam = $this->store->getStore(STORE_SIP);
...@@ -426,7 +426,7 @@ abstract class AbstractBuildForm { ...@@ -426,7 +426,7 @@ abstract class AbstractBuildForm {
* @param $htmlFormElementId * @param $htmlFormElementId
* @param $value * @param $value
* @return string * @return string
* @throws UserException * @throws UserFormException
*/ */
public function buildInput(array $formElement, $htmlFormElementId, $value, &$json) { public function buildInput(array $formElement, $htmlFormElementId, $value, &$json) {
$textarea = ''; $textarea = '';
...@@ -547,7 +547,7 @@ abstract class AbstractBuildForm { ...@@ -547,7 +547,7 @@ abstract class AbstractBuildForm {
* @param $type * @param $type
* @param $data * @param $data
* @return string * @return string
* @throws \qfq\UserException * @throws \qfq\UserFormException
*/ */
private function getInputCheckPattern($type, $data) { private function getInputCheckPattern($type, $data) {
$attribute = ''; $attribute = '';
...@@ -561,7 +561,7 @@ abstract class AbstractBuildForm { ...@@ -561,7 +561,7 @@ abstract class AbstractBuildForm {
case SANITIZE_ALLOW_MIN_MAX_DATE: case SANITIZE_ALLOW_MIN_MAX_DATE:
$arrData = explode("|", $data); $arrData = explode("|", $data);
if (count($arrData) != 2 || $arrData[0] == '' || $arrData[1] == '') if (count($arrData) != 2 || $arrData[0] == '' || $arrData[1] == '')
throw new UserException("Missing MIN|MAX values", ERROR_MISSING_MIN_MAX); throw new UserFormException("Missing MIN|MAX values", ERROR_MISSING_MIN_MAX);
$attribute = 'min="' . $arrData[0] . '" '; $attribute = 'min="' . $arrData[0] . '" ';
$attribute .= 'max="' . $arrData[1] . '" '; $attribute .= 'max="' . $arrData[1] . '" ';
...@@ -587,7 +587,7 @@ abstract class AbstractBuildForm { ...@@ -587,7 +587,7 @@ abstract class AbstractBuildForm {
* *
* @param array $formElement * @param array $formElement
* @return string * @return string
* @throws UserException * @throws UserFormException
*/ */
private function getAttributeMode(array $formElement) { private function getAttributeMode(array $formElement) {
$attribute = ''; $attribute = '';
...@@ -609,7 +609,7 @@ abstract class AbstractBuildForm { ...@@ -609,7 +609,7 @@ abstract class AbstractBuildForm {
default: default:
$this->store->setVar(SYSTEM_FORM_ELEMENT, $formElement['name'] . ' / ' . $formElement['id'], STORE_SYSTEM); $this->store->setVar(SYSTEM_FORM_ELEMENT, $formElement['name'] . ' / ' . $formElement['id'], STORE_SYSTEM);
$this->store->setVar(SYSTEM_FORM_ELEMENT_COLUMN, 'mode', STORE_SYSTEM); $this->store->setVar(SYSTEM_FORM_ELEMENT_COLUMN, 'mode', STORE_SYSTEM);
throw new UserException("Unknown mode '" . $formElement['mode'] . "'", ERROR_UNKNOWN_MODE); throw new UserFormException("Unknown mode '" . $formElement['mode'] . "'", ERROR_UNKNOWN_MODE);
break; break;
} }
return $attribute; return $attribute;
...@@ -645,7 +645,7 @@ abstract class AbstractBuildForm { ...@@ -645,7 +645,7 @@ abstract class AbstractBuildForm {
* @param $htmlFormElementId * @param $htmlFormElementId
* @param $value * @param $value
* @return string * @return string
* @throws UserException * @throws UserFormException
*/ */
public function buildCheckbox(array $formElement, $htmlFormElementId, $value, &$json) { public function buildCheckbox(array $formElement, $htmlFormElementId, $value, &$json) {
$itemKey = array(); $itemKey = array();
...@@ -678,7 +678,7 @@ abstract class AbstractBuildForm { ...@@ -678,7 +678,7 @@ abstract class AbstractBuildForm {
$html = $this->buildCheckboxMulti($formElement, $htmlFormElementId, $attributeBase, $value, $itemKey, $itemValue); $html = $this->buildCheckboxMulti($formElement, $htmlFormElementId, $attributeBase, $value, $itemKey, $itemValue);
break; break;
default: default:
throw new UserException('checkBoxMode: \'' . $formElement['checkBoxMode'] . '\' is unknown.', ERROR_CHECKBOXMODE_UNKNOWN); throw new UserFormException('checkBoxMode: \'' . $formElement['checkBoxMode'] . '\' is unknown.', ERROR_CHECKBOXMODE_UNKNOWN);
} }
$json = $this->getJsonElementUpdate($htmlFormElementId, $value, $formElement['mode']); $json = $this->getJsonElementUpdate($htmlFormElementId, $value, $formElement['mode']);
...@@ -699,7 +699,7 @@ abstract class AbstractBuildForm { ...@@ -699,7 +699,7 @@ abstract class AbstractBuildForm {
* @param $itemKey * @param $itemKey
* @param $itemValue * @param $itemValue
* @throws CodeException * @throws CodeException
* @throws \qfq\UserException * @throws \qfq\UserFormException
*/ */
public function getKeyValueListFromSqlEnumSpec(array $formElement, &$itemKey, &$itemValue) { public function getKeyValueListFromSqlEnumSpec(array $formElement, &$itemKey, &$itemValue) {
$fieldType = ''; $fieldType = '';
...@@ -735,7 +735,7 @@ abstract class AbstractBuildForm { ...@@ -735,7 +735,7 @@ abstract class AbstractBuildForm {
} elseif ($fieldType === 'enum' || $fieldType === 'set') { } elseif ($fieldType === 'enum' || $fieldType === 'set') {
// already done at the beginning with '$this->getItemsForEnumOrSet($formElement['name'], $fieldType);' // already done at the beginning with '$this->getItemsForEnumOrSet($formElement['name'], $fieldType);'
} else { } else {
throw new UserException("Missing definition (- nothing found in 'sql1', 'parameter:itemValues', 'enum-' or 'set-definition'", ERROR_MISSING_ITEM_VALUES); throw new UserFormException("Missing definition (- nothing found in 'sql1', 'parameter:itemValues', 'enum-' or 'set-definition'", ERROR_MISSING_ITEM_VALUES);
} }
if (count($itemKey) === 0) { if (count($itemKey) === 0) {
...@@ -767,7 +767,7 @@ abstract class AbstractBuildForm { ...@@ -767,7 +767,7 @@ abstract class AbstractBuildForm {
* @param $column * @param $column
* @param $fieldType * @param $fieldType
* @return array * @return array
* @throws UserException * @throws UserFormException
*/ */
private function getItemsForEnumOrSet($column, &$fieldType) { private function getItemsForEnumOrSet($column, &$fieldType) {
...@@ -775,7 +775,7 @@ abstract class AbstractBuildForm { ...@@ -775,7 +775,7 @@ abstract class AbstractBuildForm {
$fieldTypeDefinition = $this->store->getVar($column, STORE_TABLE_COLUMN_TYPES); $fieldTypeDefinition = $this->store->getVar($column, STORE_TABLE_COLUMN_TYPES);
if ($fieldTypeDefinition === false) { if ($fieldTypeDefinition === false) {
throw new UserException("Column '$column' unknown in table '" . $this->formSpec['tableName'] . "'", ERROR_DB_UNKNOWN_COLUMN); throw new UserFormException("Column '$column' unknown in table '" . $this->formSpec['tableName'] . "'", ERROR_DB_UNKNOWN_COLUMN);
} }
$length = strlen($fieldTypeDefinition); $length = strlen($fieldTypeDefinition);
...@@ -809,7 +809,7 @@ abstract class AbstractBuildForm { ...@@ -809,7 +809,7 @@ abstract class AbstractBuildForm {
* *
* @param array $itemKey * @param array $itemKey
* @param array $formElement * @param array $formElement
* @throws UserException * @throws UserFormException
*/ */
private function prepareCheckboxCheckedUncheckedValue(array $itemKey, array &$formElement) { private function prepareCheckboxCheckedUncheckedValue(array $itemKey, array &$formElement) {
...@@ -833,7 +833,7 @@ abstract class AbstractBuildForm { ...@@ -833,7 +833,7 @@ abstract class AbstractBuildForm {
} }
if ($formElement[CHECKBOX_VALUE_CHECKED] === $formElement[CHECKBOX_VALUE_UNCHECKED]) { if ($formElement[CHECKBOX_VALUE_CHECKED] === $formElement[CHECKBOX_VALUE_UNCHECKED]) {
throw new UserException('FormElement: type=checkbox - checked and unchecked can\'t be the same: ' . $formElement[CHECKBOX_VALUE_CHECKED], ERROR_CHECKBOX_EQUAL); throw new UserFormException('FormElement: type=checkbox - checked and unchecked can\'t be the same: ' . $formElement[CHECKBOX_VALUE_CHECKED], ERROR_CHECKBOX_EQUAL);
} }
} }
...@@ -973,7 +973,7 @@ abstract class AbstractBuildForm { ...@@ -973,7 +973,7 @@ abstract class AbstractBuildForm {
* @param $htmlFormElementId * @param $htmlFormElementId
* @param $value * @param $value
* @return string * @return string
* @throws UserException * @throws UserFormException
*/ */
public function buildRadio(array $formElement, $htmlFormElementId, $value, &$json) { public function buildRadio(array $formElement, $htmlFormElementId, $value, &$json) {
$itemKey = array(); $itemKey = array();
...@@ -1086,7 +1086,7 @@ abstract class AbstractBuildForm { ...@@ -1086,7 +1086,7 @@ abstract class AbstractBuildForm {
* @param $htmlFormElementId * @param $htmlFormElementId
* @param $value * @param $value
* @return string * @return string
* @throws UserException * @throws UserFormException
*/ */
public function buildSubrecord(array $formElement, $htmlFormElementId, $value, &$json) { public function buildSubrecord(array $formElement, $htmlFormElementId, $value, &$json) {
$rcText = false; $rcText = false;
...@@ -1161,7 +1161,7 @@ abstract class AbstractBuildForm { ...@@ -1161,7 +1161,7 @@ abstract class AbstractBuildForm {
* @param $rcText * @param $rcText
* @param $nameColumnId * @param $nameColumnId
* @return bool * @return bool
* @throws \qfq\UserException * @throws \qfq\UserFormException
*/ */
private function prepareSubrecod(array $formElement, array $primaryRecord, &$rcText, &$nameColumnId) { private function prepareSubrecod(array $formElement, array $primaryRecord, &$rcText, &$nameColumnId) {
...@@ -1171,7 +1171,7 @@ abstract class AbstractBuildForm { ...@@ -1171,7 +1171,7 @@ abstract class AbstractBuildForm {
} }
if (!is_array($formElement['sql1'])) { if (!is_array($formElement['sql1'])) {
throw new UserException('Missing \'sql1\' Query', ERROR_MISSING_SQL1); throw new UserFormException('Missing \'sql1\' Query', ERROR_MISSING_SQL1);
} }
// No records? // No records?
...@@ -1184,7 +1184,7 @@ abstract class AbstractBuildForm { ...@@ -1184,7 +1184,7 @@ abstract class AbstractBuildForm {
$nameColumnId = '_id'; $nameColumnId = '_id';
if (!isset($formElement['sql1'][0][$nameColumnId])) { if (!isset($formElement['sql1'][0][$nameColumnId])) {
throw new UserException('Missing column \'id\' (or "@_id") in \'sql1\' Query', ERROR_DB_MISSING_COLUMN_ID); throw new UserFormException('Missing column \'id\' (or "@_id") in \'sql1\' Query', ERROR_DB_MISSING_COLUMN_ID);
} }
return true; return true;
...@@ -1208,7 +1208,7 @@ abstract class AbstractBuildForm { ...@@ -1208,7 +1208,7 @@ abstract class AbstractBuildForm {
* @param $targetRecordId * @param $targetRecordId
* @param $record * @param $record
* @return string * @return string
* @throws UserException * @throws UserFormException
*/ */
private function createFormLink(array $formElement, $targetRecordId, array $record, $symbol, $toolTip) { private function createFormLink(array $formElement, $targetRecordId, array $record, $symbol, $toolTip) {
...@@ -1286,7 +1286,7 @@ abstract class AbstractBuildForm { ...@@ -1286,7 +1286,7 @@ abstract class AbstractBuildForm {
* *
* @param $titleRaw * @param $titleRaw
* @return array * @return array
* @throws UserException * @throws UserFormException
*/ */
private function getSubrecordColumnControl(array $titleRaw) { private function getSubrecordColumnControl(array $titleRaw) {
$control = array(); $control = array();
...@@ -1396,7 +1396,7 @@ abstract class AbstractBuildForm { ...@@ -1396,7 +1396,7 @@ abstract class AbstractBuildForm {
* @param $htmlFormElementId * @param $htmlFormElementId
* @param $value * @param $value
* @return string * @return string
* @throws UserException * @throws UserFormException
*/ */
public function buildFile(array $formElement, $htmlFormElementId, $value, &$json) { public function buildFile(array $formElement, $htmlFormElementId, $value, &$json) {
...@@ -1417,11 +1417,11 @@ abstract class AbstractBuildForm { ...@@ -1417,11 +1417,11 @@ abstract class AbstractBuildForm {
* @param array $formElement * @param array $formElement
* @param $htmlFormElementId * @param $htmlFormElementId
* @param $value * @param $value
* @throws UserException * @throws UserFormException
*/ */
public function buildDateJQW(array $formElement, $htmlFormElementId, $value) { public function buildDateJQW(array $formElement, $htmlFormElementId, $value) {
// TODO: implement // TODO: implement
throw new UserException("Not implemented yet: buildDateJQW()", ERROR_NOT_IMPLEMENTED); throw new UserFormException("Not implemented yet: buildDateJQW()", ERROR_NOT_IMPLEMENTED);
} }
/** /**
...@@ -1430,11 +1430,11 @@ abstract class AbstractBuildForm { ...@@ -1430,11 +1430,11 @@ abstract class AbstractBuildForm {
* @param array $formElement * @param array $formElement
* @param $htmlFormElementId * @param $htmlFormElementId
* @param $value * @param $value
* @throws UserException * @throws UserFormException
*/ */
public function buildGridJQW(array $formElement, $htmlFormElementId, $value) { public function buildGridJQW(array $formElement, $htmlFormElementId, $value) {
// TODO: implement // TODO: implement
throw new UserException("Not implemented yet: buildGridJQW()", ERROR_NOT_IMPLEMENTED); throw new UserFormException("Not implemented yet: buildGridJQW()", ERROR_NOT_IMPLEMENTED);
} }
/** /**
......
...@@ -90,7 +90,7 @@ class BodytextParser { ...@@ -90,7 +90,7 @@ class BodytextParser {
/** /**
* @param $bodytext * @param $bodytext
* @return mixed|string * @return mixed|string
* @throws UserException * @throws UserFormException
*/ */
private function unNest($bodytext) { private function unNest($bodytext) {
// Replace '\{' | '\}' by internal token. All remaining '}' | '{' means: 'nested' // Replace '\{' | '\}' by internal token. All remaining '}' | '{' means: 'nested'
...@@ -106,7 +106,7 @@ class BodytextParser { ...@@ -106,7 +106,7 @@ class BodytextParser {
$posMatchOpen = strrpos(substr($result, 0, $posFirstClose), '{'); $posMatchOpen = strrpos(substr($result, 0, $posFirstClose), '{');
if ($posMatchOpen === false) { if ($posMatchOpen === false) {
throw new \qfq\UserException("Missing open delimiter: $result", ERROR_MISSING_OPEN_DELIMITER); throw new \qfq\UserFormException("Missing open delimiter: $result", ERROR_MISSING_OPEN_DELIMITER);
} }
$pre = substr($result, 0, $posMatchOpen); $pre = substr($result, 0, $posMatchOpen);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
namespace qfq; namespace qfq;
use qfq; use qfq;
use qfq\UserException; use qfq\UserFormException;
require_once(__DIR__ . '/../qfq/Constants.php'); require_once(__DIR__ . '/../qfq/Constants.php');
require_once(__DIR__ . '/../qfq/helper/OnArray.php'); require_once(__DIR__ . '/../qfq/helper/OnArray.php');
...@@ -180,7 +180,7 @@ BUTTON; ...@@ -180,7 +180,7 @@ BUTTON;
/** /**
* @param $pillArray * @param $pillArray
* @return string * @return string
* @throws UserException * @throws UserFormException
*/ */
private function buildPillNavigation($pillArray) { private function buildPillNavigation($pillArray) {
$pillButton = ''; $pillButton = '';
...@@ -201,7 +201,7 @@ BUTTON; ...@@ -201,7 +201,7 @@ BUTTON;
if ($formElement['name'] === '' || $formElement['label'] === '') { if ($formElement['name'] === '' || $formElement['label'] === '') {
$this->store->setVar(SYSTEM_FORM_ELEMENT, $formElement['name'] . ' / ' . $formElement['id'], STORE_SYSTEM); $this->store->setVar(SYSTEM_FORM_ELEMENT, $formElement['name'] . ' / ' . $formElement['id'], STORE_SYSTEM);
$this->store->setVar(SYSTEM_FORM_ELEMENT_COLUMN, 'name, label', STORE_SYSTEM); $this->store->setVar(SYSTEM_FORM_ELEMENT_COLUMN, 'name, label', STORE_SYSTEM);
throw new UserException("Field 'name' and/or 'label' are empty", ERROR_NAME_LABEL_EMPTY); throw new UserFormException("Field 'name' and/or 'label' are empty", ERROR_NAME_LABEL_EMPTY);
} }
// Anker for pill navigation // Anker for pill navigation
......
...@@ -238,6 +238,9 @@ const SYSTEM_FORM = CLIENT_FORM; // '<formName> / <formId ...@@ -238,6 +238,9 @@ const SYSTEM_FORM = CLIENT_FORM; // '<formName> / <formId
const SYSTEM_FORM_ELEMENT = 'formElement'; // '<formElementName> / <formElementeId>' const SYSTEM_FORM_ELEMENT = 'formElement'; // '<formElementName> / <formElementeId>'
const SYSTEM_FORM_ELEMENT_COLUMN = 'formElementColumn'; // '<columnname of current processed formElement>' const SYSTEM_FORM_ELEMENT_COLUMN = 'formElementColumn'; // '<columnname of current processed formElement>'
const SYSTEM_FORM_ELEMENT_MESSAGE = 'formElementMessage'; // '<columnname of current processed formElement>' const SYSTEM_FORM_ELEMENT_MESSAGE = 'formElementMessage'; // '<columnname of current processed formElement>'
const SYSTEM_REPORT_COLUMN_KEY = 'reportColumnKey'; // Keyname of SQL-column processed at the moment.
const SYSTEM_REPORT_COLUMN_VALUE = 'reportColumnValue'; // Keyname of SQL-column processed at the moment.
const SYSTEM_REPORT_FULL_LEVEL = 'reportFullLevel'; // Keyname of SQL-column processed at the moment.
// die folgenden Elemente sind vermutlich nicht noetig, wenn Store Klassen gloable Vars benutzt. // die folgenden Elemente sind vermutlich nicht noetig, wenn Store Klassen gloable Vars benutzt.
//const SYSTEM_FORM_DEF = 'formDefinition'; // Type: SANITIZE_ALNUMX / AssocArray. Final form to process. Useful for error reporting. //const SYSTEM_FORM_DEF = 'formDefinition'; // Type: SANITIZE_ALNUMX / AssocArray. Final form to process. Useful for error reporting.
......
...@@ -11,7 +11,7 @@ namespace qfq; ...@@ -11,7 +11,7 @@ namespace qfq;
use qfq; use qfq;
use qfq\CodeException; use qfq\CodeException;
use qfq\DbException; use qfq\DbException;
use qfq\UserException; use qfq\UserFormException;
use qfq\Support; use qfq\Support;
use qfq\Store; use qfq\Store;
...@@ -60,7 +60,7 @@ class Database { ...@@ -60,7 +60,7 @@ class Database {
* If not exists: open database and store the new dbh in Store[System][SYSTEM_DBH] * If not exists: open database and store the new dbh in Store[System][SYSTEM_DBH]
* *
* @throws CodeException * @throws CodeException
* @throws UserException * @throws UserFormException
*/ */
public function __construct() { public function __construct() {
$this->store = Store::getInstance(); $this->store = Store::getInstance();
...@@ -76,7 +76,7 @@ class Database { ...@@ -76,7 +76,7 @@ class Database {
* Open mysqli database connection if not already done. * Open mysqli database connection if not already done.
* *
* @return \mysqli * @return \mysqli
* @throws UserException * @throws UserFormException
*/ */
private function dbConnect() { private function dbConnect() {
$mysqli = null; $mysqli = null;
...@@ -89,7 +89,7 @@ class Database { ...@@ -89,7 +89,7 @@ class Database {
$mysqli = new \mysqli($dbserver, $dbuser, $dbpw, $db); $mysqli = new \mysqli($dbserver, $dbuser, $dbpw, $db);
if ($mysqli->connect_error) { if ($mysqli->connect_error) {
throw new UserException ("Error open Database 'mysql:host=" . $dbserver . ";dbname=" . $db . ";dbuser=" . $dbuser . "'': " . $mysqli->connect_errno . PHP_EOL . $mysqli->connect_error, ERROR_DB_OPEN); throw new UserFormException ("Error open Database 'mysql:host=" . $dbserver . ";dbname=" . $db . ";dbuser=" . $dbuser . "'': " . $mysqli->connect_errno . PHP_EOL . $mysqli->connect_error, ERROR_DB_OPEN);
} }
return $mysqli; return $mysqli;
...@@ -117,7 +117,7 @@ class Database { ...@@ -117,7 +117,7 @@ class Database {
* @param string $table name of the table * @param string $table name of the table
* @param string $columnName name of the column * @param string $columnName name of the column
* *
* @throws UserException if the table or column does not exist, or is not of type ENUM or SET * @throws UserFormException if the table or column does not exist, or is not of type ENUM or SET
* @return array * @return array
*/ */
public function getEnumSetValueList($table, $columnName) { public function getEnumSetValueList($table, $columnName) {
...@@ -296,7 +296,7 @@ class Database { ...@@ -296,7 +296,7 @@ class Database {
* @return int|mixed * @return int|mixed
* @throws \qfq\CodeException * @throws \qfq\CodeException
* @throws \qfq\DbException * @throws \qfq\DbException
* @throws \qfq\UserException * @throws \qfq\UserFormException
*/ */
private function prepareExecute($sql, array $parameterArray = array()) { private function prepareExecute($sql, array $parameterArray = array()) {
$result = 0; $result = 0;
...@@ -364,7 +364,7 @@ class Database { ...@@ -364,7 +364,7 @@ class Database {
* @param $sql * @param $sql
* @param array $parameterArray * @param array $parameterArray
* @return string * @return string
* @throws \qfq\UserException * @throws \qfq\UserFormException
*/ */
private function dbLog($sql, $parameterArray = array()) { private function dbLog($sql, $parameterArray = array()) {
...@@ -380,7 +380,7 @@ class Database { ...@@ -380,7 +380,7 @@ class Database {
// nothing to log. // nothing to log.
return;