|
@@ -1,7 +1,7 @@
|
|
|
<?php
|
|
<?php
|
|
|
|
|
|
|
|
-Lib::loadClass('Core_StorageObject');
|
|
|
|
|
-Lib::loadClass('Core_StorageField');
|
|
|
|
|
|
|
+// Lib::loadClass('Core_StorageObject');
|
|
|
|
|
+// Lib::loadClass('Core_StorageField');
|
|
|
|
|
|
|
|
class Core_StorageBase {
|
|
class Core_StorageBase {
|
|
|
|
|
|
|
@@ -24,24 +24,24 @@ class Core_StorageBase {
|
|
|
return $this->_pdo->getType();
|
|
return $this->_pdo->getType();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function getObject($tableName) {
|
|
|
|
|
- $storageZasobId = $this->getZasobId();
|
|
|
|
|
- $storageObject = new Core_StorageObject("{$storageZasobId}/{$tableName}");
|
|
|
|
|
- $tableStruct = $this->getTableStruct($tableName);
|
|
|
|
|
- $pkFieldName = null;
|
|
|
|
|
- foreach ($tableStruct as $fldName => $vFldType) {
|
|
|
|
|
- $vField = new Core_StorageField("{$storageZasobId}/{$tableName}/{$fldName}");
|
|
|
|
|
- $vField->setName($fldName);
|
|
|
|
|
- $storageObject->setField($vField);
|
|
|
|
|
- if ($vFldType->isPrimaryKey()) {
|
|
|
|
|
- $pkFieldName = $fldName;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- if ($pkFieldName) {
|
|
|
|
|
- $storageObject->setPrimaryKeyFieldName($pkFieldName);
|
|
|
|
|
- }
|
|
|
|
|
- return $storageObject;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // public function getObject($tableName) {
|
|
|
|
|
+ // $storageZasobId = $this->getZasobId();
|
|
|
|
|
+ // $storageObject = new Core_StorageObject("{$storageZasobId}/{$tableName}");
|
|
|
|
|
+ // $tableStruct = $this->getTableStruct($tableName);
|
|
|
|
|
+ // $pkFieldName = null;
|
|
|
|
|
+ // foreach ($tableStruct as $fldName => $vFldType) {
|
|
|
|
|
+ // $vField = new Core_StorageField("{$storageZasobId}/{$tableName}/{$fldName}");
|
|
|
|
|
+ // $vField->setName($fldName);
|
|
|
|
|
+ // $storageObject->setField($vField);
|
|
|
|
|
+ // if ($vFldType->isPrimaryKey()) {
|
|
|
|
|
+ // $pkFieldName = $fldName;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ // if ($pkFieldName) {
|
|
|
|
|
+ // $storageObject->setPrimaryKeyFieldName($pkFieldName);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // return $storageObject;
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
public function getTableStruct($tableName) {
|
|
public function getTableStruct($tableName) {
|
|
|
$storageZasobId = $this->getZasobId();
|
|
$storageZasobId = $this->getZasobId();
|