|
|
@@ -207,6 +207,29 @@ class Schema_DefaultDb_zaliczka_ZaliczkaStorageAcl extends Core_AclSimpleSchemaB
|
|
|
return $id;
|
|
|
}
|
|
|
|
|
|
+ public function getItem($primaryKey) {
|
|
|
+ $zaliczkaRaw = DB::getPDO()->fetchAll("
|
|
|
+ select t.*
|
|
|
+ from `ZALICZKA` t
|
|
|
+ where t.ID = {$primaryKey}
|
|
|
+ ");
|
|
|
+ $zaliczkaRaw = (!empty($zaliczkaRaw)) ? reset($zaliczkaRaw) : null;
|
|
|
+ DBG::nicePrint($zaliczkaRaw, '$zaliczkaRaw');
|
|
|
+ if (!$zaliczkaRaw) return null;
|
|
|
+
|
|
|
+ foreach ($this->_simpleSchema['root'] as $fieldName => $field) {
|
|
|
+ if ('@' == substr($fieldName, 0, 1)) continue;
|
|
|
+ DBG::nicePrint($field, '$field['.$fieldName.']');
|
|
|
+ if (!empty($field['@type'])) {
|
|
|
+ UI::alert('warning', "TODO: field({$fieldName}) type({$field['@type']})");
|
|
|
+ } else if (!empty($field['@ref'])) {
|
|
|
+ UI::alert('warning', "TODO: field({$fieldName}) get ref table -> fetch value/s -> fetch HIST");
|
|
|
+ } else {
|
|
|
+ throw new Exception("Schema error for field '{$fieldName}'");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public function reinstall() {
|
|
|
// TODO: mv to Core_AclSimpleSchemaBase and reainstall by _simpleSchema - read current data from `information_schema`
|
|
|
DB::getPDO()->exec("
|