mirror of
https://github.com/Karaka-Management/oms-Exchange.git
synced 2026-02-08 22:08:41 +00:00
new datamapper mostly implemented
This commit is contained in:
parent
0df075fe7d
commit
75bfac9774
|
|
@ -55,7 +55,7 @@ final class Installer extends InstallerAbstract
|
|||
$exchange = new InterfaceManager(__DIR__ . '/../Interfaces/' . $interface);
|
||||
$exchange->load();
|
||||
|
||||
InterfaceManagerMapper::create($exchange);
|
||||
InterfaceManagerMapper::create()->execute($exchange);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ use phpOMS\Message\RequestAbstract;
|
|||
use phpOMS\Message\ResponseAbstract;
|
||||
use phpOMS\Model\Message\FormValidation;
|
||||
use phpOMS\System\File\Local\Directory;
|
||||
use phpOMS\System\MimeType;
|
||||
|
||||
/**
|
||||
* Exchange controller class.
|
||||
|
|
@ -87,7 +86,7 @@ final class ApiController extends Controller
|
|||
private function importDataFromRequest(RequestAbstract $request) : array
|
||||
{
|
||||
/** @var \Modules\Exchange\Models\InterfaceManager $interface */
|
||||
$interface = InterfaceManagerMapper::get($request->getData('id'));
|
||||
$interface = InterfaceManagerMapper::get()->where('id', $request->getData('id'))->execute();
|
||||
$dirname = \basename(\dirname($interface->getPath()));
|
||||
|
||||
if (!Autoloader::exists($class = '\\Modules\\Exchange\\Interfaces\\' . $dirname . '\\Importer')) {
|
||||
|
|
@ -148,7 +147,7 @@ final class ApiController extends Controller
|
|||
);
|
||||
$interface->load();
|
||||
|
||||
InterfaceManagerMapper::create($interface);
|
||||
InterfaceManagerMapper::create()->execute($interface);
|
||||
|
||||
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Interface', 'Interface successfully installed', $interface);
|
||||
}
|
||||
|
|
@ -220,7 +219,7 @@ final class ApiController extends Controller
|
|||
private function exportDataFromRequest(RequestAbstract $request) : array
|
||||
{
|
||||
/** @var \Modules\Exchange\Models\InterfaceManager $interface */
|
||||
$interface = InterfaceManagerMapper::get($request->getData('id'));
|
||||
$interface = InterfaceManagerMapper::get()->where('id', $request->getData('id'))->execute();
|
||||
$dirname = \basename(\dirname($interface->getPath()));
|
||||
|
||||
if (!Autoloader::exists($class = '\\Modules\\Exchange\\Interfaces\\' . $dirname . '\\Exporter')) {
|
||||
|
|
|
|||
|
|
@ -52,15 +52,15 @@ final class BackendController extends Controller
|
|||
|
||||
if ($request->getData('ptype') === 'p') {
|
||||
$view->setData('logs',
|
||||
ExchangeLogMapper::getBeforePivot((int) ($request->getData('id') ?? 0), limit: 25, depth: 4)
|
||||
ExchangeLogMapper::getAll()->where('id', (int) ($request->getData('id') ?? 0), '<')->limit(25)->execute()
|
||||
);
|
||||
} elseif ($request->getData('ptype') === 'n') {
|
||||
$view->setData('logs',
|
||||
ExchangeLogMapper::getAfterPivot((int) ($request->getData('id') ?? 0), limit: 25, depth: 4)
|
||||
ExchangeLogMapper::getAll()->where('id', (int) ($request->getData('id') ?? 0), '>')->limit(25)->execute()
|
||||
);
|
||||
} else {
|
||||
$view->setData('logs',
|
||||
ExchangeLogMapper::getAfterPivot(0, limit: 25, depth: 4)
|
||||
ExchangeLogMapper::getAll()->where('id', 0, '>')->limit(25)->execute()
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -85,7 +85,7 @@ final class BackendController extends Controller
|
|||
$view->setTemplate('/Modules/Exchange/Theme/Backend/exchange-log');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1007001001, $request, $response));
|
||||
|
||||
$log = ExchangeLogMapper::get((int) $request->getData('id'));
|
||||
$log = ExchangeLogMapper::get()->where('id', (int) $request->getData('id'))->execute();
|
||||
$view->setData('log', $log);
|
||||
|
||||
return $view;
|
||||
|
|
@ -110,7 +110,7 @@ final class BackendController extends Controller
|
|||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1007001001, $request, $response));
|
||||
|
||||
/** @var \Modules\Exchange\Models\InterfaceManager[] $interfaces */
|
||||
$interfaces = InterfaceManagerMapper::getAll();
|
||||
$interfaces = InterfaceManagerMapper::getAll()->execute();
|
||||
|
||||
$export = [];
|
||||
foreach ($interfaces as $interface) {
|
||||
|
|
@ -143,7 +143,7 @@ final class BackendController extends Controller
|
|||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1007001001, $request, $response));
|
||||
|
||||
/** @var \Modules\Exchange\Models\InterfaceManager[] $interfaces */
|
||||
$interfaces = InterfaceManagerMapper::getAll();
|
||||
$interfaces = InterfaceManagerMapper::getAll()->execute();
|
||||
|
||||
$import = [];
|
||||
foreach ($interfaces as $interface) {
|
||||
|
|
@ -176,7 +176,7 @@ final class BackendController extends Controller
|
|||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1007001001, $request, $response));
|
||||
|
||||
/** @var \Modules\Exchange\Models\InterfaceManager $interface */
|
||||
$interface = InterfaceManagerMapper::get((int) $request->getData('id'));
|
||||
$interface = InterfaceManagerMapper::get()->where('id', (int) $request->getData('id'))->execute();
|
||||
|
||||
$view->addData('interface', $interface);
|
||||
|
||||
|
|
@ -205,7 +205,7 @@ final class BackendController extends Controller
|
|||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1007001001, $request, $response));
|
||||
|
||||
/** @var \Modules\Exchange\Models\InterfaceManager $interface */
|
||||
$interface = InterfaceManagerMapper::get((int) $request->getData('id'));
|
||||
$interface = InterfaceManagerMapper::get()->where('id', (int) $request->getData('id'))->execute();
|
||||
|
||||
$view->addData('interface', $interface);
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ use Modules\SupplierManagement\Models\Supplier;
|
|||
use Modules\SupplierManagement\Models\SupplierMapper;
|
||||
use phpOMS\DataStorage\Database\Connection\ConnectionFactory;
|
||||
use phpOMS\DataStorage\Database\DatabaseStatus;
|
||||
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||
use phpOMS\Localization\ISO3166TwoEnum;
|
||||
use phpOMS\Localization\ISO639x1Enum;
|
||||
use phpOMS\Message\RequestAbstract;
|
||||
|
|
@ -181,7 +181,7 @@ final class Importer extends ImporterAbstract
|
|||
*/
|
||||
public function importCostCenter(\DateTime $start, \DateTime $end) : void
|
||||
{
|
||||
DataMapperAbstract::setConnection($this->remote);
|
||||
DataMapperFactory::db($this->remote);
|
||||
$query = GSDCostCenterMapper::getQuery();
|
||||
$query->where('FiKostenstellen_3.row_create_time', '>=', $start)
|
||||
->andWhere('FiKostenstellen_3.row_create_time', '<=', $end);
|
||||
|
|
@ -189,14 +189,14 @@ final class Importer extends ImporterAbstract
|
|||
/** @var GSDCostCenter[] $costCenters */
|
||||
$costCenters = GSDCostCenterMapper::getAllByQuery($query);
|
||||
|
||||
DataMapperAbstract::setConnection($this->local);
|
||||
DataMapperFactory::db($this->local);
|
||||
|
||||
foreach ($costCenters as $cc) {
|
||||
$obj = new CostCenter();
|
||||
$obj->code = $cc->getCostCenter();
|
||||
$obj->l11n->name = \trim($cc->description, " ,\t");
|
||||
|
||||
CostCenterMapper::create($obj);
|
||||
CostCenterMapper::create()->execute($obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -212,7 +212,7 @@ final class Importer extends ImporterAbstract
|
|||
*/
|
||||
public function importCostObject(\DateTime $start, \DateTime $end) : void
|
||||
{
|
||||
DataMapperAbstract::setConnection($this->remote);
|
||||
DataMapperFactory::db($this->remote);
|
||||
$query = GSDCostObjectMapper::getQuery();
|
||||
$query->where('FiKostentraeger_3.row_create_time', '>=', $start)
|
||||
->andWhere('FiKostentraeger_3.row_create_time', '<=', $end);
|
||||
|
|
@ -220,14 +220,14 @@ final class Importer extends ImporterAbstract
|
|||
/** @var GSDCostObject[] $costObjects */
|
||||
$costObjects = GSDCostObjectMapper::getAllByQuery($query);
|
||||
|
||||
DataMapperAbstract::setConnection($this->local);
|
||||
DataMapperFactory::db($this->local);
|
||||
|
||||
foreach ($costObjects as $co) {
|
||||
$obj = new CostObject();
|
||||
$obj->code = $co->getCostObject();
|
||||
$obj->l11n->name = \trim($co->description, " ,\t");
|
||||
|
||||
CostObjectMapper::create($obj);
|
||||
CostObjectMapper::create()->execute($obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -243,7 +243,7 @@ final class Importer extends ImporterAbstract
|
|||
*/
|
||||
public function importCustomer(\DateTime $start, \DateTime $end) : void
|
||||
{
|
||||
DataMapperAbstract::setConnection($this->remote);
|
||||
DataMapperFactory::db($this->remote);
|
||||
$query = GSDCustomerMapper::getQuery();
|
||||
$query->where('Kunden_3.row_create_time', '>=', $start)
|
||||
->andWhere('Kunden_3.row_create_time', '<=', $end);
|
||||
|
|
@ -251,7 +251,7 @@ final class Importer extends ImporterAbstract
|
|||
/** @var GSDCustomer[] $customers */
|
||||
$customers = GSDCustomerMapper::getAllByQuery($query);
|
||||
|
||||
DataMapperAbstract::setConnection($this->local);
|
||||
DataMapperFactory::db($this->local);
|
||||
|
||||
foreach ($customers as $customer) {
|
||||
$account = new Account();
|
||||
|
|
@ -306,7 +306,7 @@ final class Importer extends ImporterAbstract
|
|||
$obj->addContactElement($email);
|
||||
}
|
||||
|
||||
ClientMapper::create($obj);
|
||||
ClientMapper::create()->execute($obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -322,7 +322,7 @@ final class Importer extends ImporterAbstract
|
|||
*/
|
||||
public function importSupplier(\DateTime $start, \DateTime $end) : void
|
||||
{
|
||||
DataMapperAbstract::setConnection($this->remote);
|
||||
DataMapperFactory::db($this->remote);
|
||||
$query = GSDSupplierMapper::getQuery();
|
||||
$query->where('Lieferanten_3.row_create_time', '>=', $start)
|
||||
->andWhere('Lieferanten_3.row_create_time', '<=', $end);
|
||||
|
|
@ -330,7 +330,7 @@ final class Importer extends ImporterAbstract
|
|||
/** @var GSDSupplier[] $suppliers */
|
||||
$suppliers = GSDSupplierMapper::getAllByQuery($query);
|
||||
|
||||
DataMapperAbstract::setConnection($this->local);
|
||||
DataMapperFactory::db($this->local);
|
||||
|
||||
foreach ($suppliers as $supplier) {
|
||||
$account = new Account();
|
||||
|
|
@ -385,7 +385,7 @@ final class Importer extends ImporterAbstract
|
|||
$obj->addContactElement($email);
|
||||
}
|
||||
|
||||
SupplierMapper::create($obj);
|
||||
SupplierMapper::create()->execute($obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -416,7 +416,7 @@ final class Importer extends ImporterAbstract
|
|||
*/
|
||||
public function importArticle(\DateTime $start, \DateTime $end, array $files = []) : void
|
||||
{
|
||||
DataMapperAbstract::setConnection($this->remote);
|
||||
DataMapperFactory::db($this->remote);
|
||||
$query = GSDArticleMapper::getQuery();
|
||||
$query->where('Artikel_3.row_create_time', '>=', $start)
|
||||
->andWhere('Artikel_3.row_create_time', '<=', $end);
|
||||
|
|
@ -424,7 +424,7 @@ final class Importer extends ImporterAbstract
|
|||
/** @var GSDArticle[] $articles */
|
||||
$articles = GSDArticleMapper::getAllByQuery($query);
|
||||
|
||||
DataMapperAbstract::setConnection($this->local);
|
||||
DataMapperFactory::db($this->local);
|
||||
|
||||
$itemL11nType = $this->createItemL11nTypes();
|
||||
$itemAttrType = $this->createItemAttributeTypes();
|
||||
|
|
@ -465,7 +465,7 @@ final class Importer extends ImporterAbstract
|
|||
$media[$number]->size = (int) \filesize($imagePath . '/' . $image);
|
||||
$media[$number]->createdBy = new NullAccount($this->account);
|
||||
|
||||
MediaMapper::create($media[$number]);
|
||||
MediaMapper::create()->execute($media[$number]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -519,7 +519,7 @@ final class Importer extends ImporterAbstract
|
|||
$obj->addFile($media[$number]);
|
||||
}
|
||||
|
||||
ItemMapper::create($obj);
|
||||
ItemMapper::create()->execute($obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -534,19 +534,19 @@ final class Importer extends ImporterAbstract
|
|||
{
|
||||
$itemL11nType = [];
|
||||
|
||||
if (($itemL11nType['name1'] = ItemL11nTypeMapper::getBy('name1', 'itemmgmt_attr_type_name')) instanceof NullItemL11nType) {
|
||||
if (($itemL11nType['name1'] = ItemL11nTypeMapper::get()->where('title', 'name1')->execute()) instanceof NullItemL11nType) {
|
||||
$itemL11nType['name1'] = new ItemL11nType('name1');
|
||||
ItemL11nTypeMapper::create($itemL11nType['name1']);
|
||||
ItemL11nTypeMapper::create()->execute($itemL11nType['name1']);
|
||||
}
|
||||
|
||||
if (($itemL11nType['name2'] = ItemL11nTypeMapper::getBy('name2', 'itemmgmt_attr_type_name')) instanceof NullItemL11nType) {
|
||||
if (($itemL11nType['name2'] = ItemL11nTypeMapper::get()->where('title', 'name2')->execute()) instanceof NullItemL11nType) {
|
||||
$itemL11nType['name2'] = new ItemL11nType('name2');
|
||||
ItemL11nTypeMapper::create($itemL11nType['name2']);
|
||||
ItemL11nTypeMapper::create()->execute($itemL11nType['name2']);
|
||||
}
|
||||
|
||||
if (($itemL11nType['info'] = ItemL11nTypeMapper::getBy('info', 'itemmgmt_attr_type_name')) instanceof NullItemL11nType) {
|
||||
if (($itemL11nType['info'] = ItemL11nTypeMapper::get()->where('title', 'info')->execute()) instanceof NullItemL11nType) {
|
||||
$itemL11nType['info'] = new ItemL11nType('info');
|
||||
ItemL11nTypeMapper::create($itemL11nType['info']);
|
||||
ItemL11nTypeMapper::create()->execute($itemL11nType['info']);
|
||||
}
|
||||
|
||||
return $itemL11nType;
|
||||
|
|
@ -563,44 +563,44 @@ final class Importer extends ImporterAbstract
|
|||
{
|
||||
$itemAttrType = [];
|
||||
|
||||
if (($itemAttrType['tradegroup'] = ItemAttributeTypeMapper::getBy('tradegroup', 'name')) instanceof NullItemAttributeType) {
|
||||
if (($itemAttrType['tradegroup'] = ItemAttributeTypeMapper::get()->where('name', 'tradegroup')->execute()) instanceof NullItemAttributeType) {
|
||||
$itemAttrType['tradegroup'] = new ItemAttributeType('tradegroup');
|
||||
ItemAttributeTypeMapper::create($itemAttrType['tradegroup']);
|
||||
ItemAttributeTypeMapper::create()->execute($itemAttrType['tradegroup']);
|
||||
|
||||
ItemAttributeTypeL11nMapper::create(new ItemAttributeTypeL11n($itemAttrType['tradegroup']->getId(), 'Trade Group', ISO639x1Enum::_EN));
|
||||
ItemAttributeTypeL11nMapper::create(new ItemAttributeTypeL11n($itemAttrType['tradegroup']->getId(), 'Handelsgruppe', ISO639x1Enum::_DE));
|
||||
ItemAttributeTypeL11nMapper::create()->execute(new ItemAttributeTypeL11n($itemAttrType['tradegroup']->getId(), 'Trade Group', ISO639x1Enum::_EN));
|
||||
ItemAttributeTypeL11nMapper::create()->execute(new ItemAttributeTypeL11n($itemAttrType['tradegroup']->getId(), 'Handelsgruppe', ISO639x1Enum::_DE));
|
||||
}
|
||||
|
||||
if (($itemAttrType['exportcontrolgroup'] = ItemAttributeTypeMapper::getBy('exportcontrolgroup', 'name')) instanceof NullItemAttributeType) {
|
||||
if (($itemAttrType['exportcontrolgroup'] = ItemAttributeTypeMapper::get()->where('name', 'exportcontrolgroup')->execute()) instanceof NullItemAttributeType) {
|
||||
$itemAttrType['exportcontrolgroup'] = new ItemAttributeType('exportcontrolgroup');
|
||||
ItemAttributeTypeMapper::create($itemAttrType['exportcontrolgroup']);
|
||||
ItemAttributeTypeMapper::create()->execute($itemAttrType['exportcontrolgroup']);
|
||||
|
||||
ItemAttributeTypeL11nMapper::create(new ItemAttributeTypeL11n($itemAttrType['exportcontrolgroup']->getId(), 'Export Control Group', ISO639x1Enum::_EN));
|
||||
ItemAttributeTypeL11nMapper::create(new ItemAttributeTypeL11n($itemAttrType['exportcontrolgroup']->getId(), 'Exportkontrollgruppe', ISO639x1Enum::_DE));
|
||||
ItemAttributeTypeL11nMapper::create()->execute(new ItemAttributeTypeL11n($itemAttrType['exportcontrolgroup']->getId(), 'Export Control Group', ISO639x1Enum::_EN));
|
||||
ItemAttributeTypeL11nMapper::create()->execute(new ItemAttributeTypeL11n($itemAttrType['exportcontrolgroup']->getId(), 'Exportkontrollgruppe', ISO639x1Enum::_DE));
|
||||
}
|
||||
|
||||
if (($itemAttrType['medicalgroup'] = ItemAttributeTypeMapper::getBy('medicalgroup', 'name')) instanceof NullItemAttributeType) {
|
||||
if (($itemAttrType['medicalgroup'] = ItemAttributeTypeMapper::get()->where('name', 'medicalgroup')->execute()) instanceof NullItemAttributeType) {
|
||||
$itemAttrType['medicalgroup'] = new ItemAttributeType('medicalgroup');
|
||||
ItemAttributeTypeMapper::create($itemAttrType['medicalgroup']);
|
||||
ItemAttributeTypeMapper::create()->execute($itemAttrType['medicalgroup']);
|
||||
|
||||
ItemAttributeTypeL11nMapper::create(new ItemAttributeTypeL11n($itemAttrType['medicalgroup']->getId(), 'Medical Device Group', ISO639x1Enum::_EN));
|
||||
ItemAttributeTypeL11nMapper::create(new ItemAttributeTypeL11n($itemAttrType['medicalgroup']->getId(), 'Medezinproduktklasse', ISO639x1Enum::_DE));
|
||||
ItemAttributeTypeL11nMapper::create()->execute(new ItemAttributeTypeL11n($itemAttrType['medicalgroup']->getId(), 'Medical Device Group', ISO639x1Enum::_EN));
|
||||
ItemAttributeTypeL11nMapper::create()->execute(new ItemAttributeTypeL11n($itemAttrType['medicalgroup']->getId(), 'Medezinproduktklasse', ISO639x1Enum::_DE));
|
||||
}
|
||||
|
||||
if (($itemAttrType['customsnumber'] = ItemAttributeTypeMapper::getBy('customsnumber', 'name')) instanceof NullItemAttributeType) {
|
||||
if (($itemAttrType['customsnumber'] = ItemAttributeTypeMapper::get()->where('name', 'customsnumber')->execute()) instanceof NullItemAttributeType) {
|
||||
$itemAttrType['customsnumber'] = new ItemAttributeType('customsnumber');
|
||||
ItemAttributeTypeMapper::create($itemAttrType['customsnumber']);
|
||||
ItemAttributeTypeMapper::create()->execute($itemAttrType['customsnumber']);
|
||||
|
||||
ItemAttributeTypeL11nMapper::create(new ItemAttributeTypeL11n($itemAttrType['customsnumber']->getId(), 'Customs Number', ISO639x1Enum::_EN));
|
||||
ItemAttributeTypeL11nMapper::create(new ItemAttributeTypeL11n($itemAttrType['customsnumber']->getId(), 'Zolltarifnummer', ISO639x1Enum::_DE));
|
||||
ItemAttributeTypeL11nMapper::create()->execute(new ItemAttributeTypeL11n($itemAttrType['customsnumber']->getId(), 'Customs Number', ISO639x1Enum::_EN));
|
||||
ItemAttributeTypeL11nMapper::create()->execute(new ItemAttributeTypeL11n($itemAttrType['customsnumber']->getId(), 'Zolltarifnummer', ISO639x1Enum::_DE));
|
||||
}
|
||||
|
||||
if (($itemAttrType['unnumber'] = ItemAttributeTypeMapper::getBy('unnumber', 'name')) instanceof NullItemAttributeType) {
|
||||
if (($itemAttrType['unnumber'] = ItemAttributeTypeMapper::get()->where('name', 'unnumber')->execute()) instanceof NullItemAttributeType) {
|
||||
$itemAttrType['unnumber'] = new ItemAttributeType('unnumber');
|
||||
ItemAttributeTypeMapper::create($itemAttrType['unnumber']);
|
||||
ItemAttributeTypeMapper::create()->execute($itemAttrType['unnumber']);
|
||||
|
||||
ItemAttributeTypeL11nMapper::create(new ItemAttributeTypeL11n($itemAttrType['unnumber']->getId(), 'UN-Number', ISO639x1Enum::_EN));
|
||||
ItemAttributeTypeL11nMapper::create(new ItemAttributeTypeL11n($itemAttrType['unnumber']->getId(), 'UN-Nummer', ISO639x1Enum::_DE));
|
||||
ItemAttributeTypeL11nMapper::create()->execute(new ItemAttributeTypeL11n($itemAttrType['unnumber']->getId(), 'UN-Number', ISO639x1Enum::_EN));
|
||||
ItemAttributeTypeL11nMapper::create()->execute(new ItemAttributeTypeL11n($itemAttrType['unnumber']->getId(), 'UN-Nummer', ISO639x1Enum::_DE));
|
||||
}
|
||||
|
||||
return $itemAttrType;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\Exchange\Interfaces\GSD\Model;
|
||||
|
||||
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||
|
||||
/**
|
||||
* Mapper class.
|
||||
|
|
@ -24,7 +24,7 @@ use phpOMS\DataStorage\Database\DataMapperAbstract;
|
|||
* @link https://orange-management.org
|
||||
* @since 1.0.0
|
||||
*/
|
||||
final class GSDAddressMapper extends DataMapperAbstract
|
||||
final class GSDAddressMapper extends DataMapperFactory
|
||||
{
|
||||
/**
|
||||
* Columns.
|
||||
|
|
@ -32,7 +32,7 @@ final class GSDAddressMapper extends DataMapperAbstract
|
|||
* @var array<string, array{name:string, type:string, internal:string, autocomplete?:bool, readonly?:bool, writeonly?:bool, annotations?:array}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static array $columns = [
|
||||
public const COLUMNS = [
|
||||
'Nummer' => ['name' => 'Nummer', 'type' => 'int', 'internal' => 'id'],
|
||||
'row_create_time' => ['name' => 'row_create_time', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt'],
|
||||
'row_create_user' => ['name' => 'row_create_user', 'type' => 'int', 'internal' => 'createdBy'],
|
||||
|
|
@ -55,7 +55,7 @@ final class GSDAddressMapper extends DataMapperAbstract
|
|||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $table = 'Adressen';
|
||||
public const TABLE = 'Adressen';
|
||||
|
||||
/**
|
||||
* Created at.
|
||||
|
|
@ -63,7 +63,7 @@ final class GSDAddressMapper extends DataMapperAbstract
|
|||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $createdAt = 'row_create_time';
|
||||
public const CREATED_AT = 'row_create_time';
|
||||
|
||||
/**
|
||||
* Primary field name.
|
||||
|
|
@ -71,5 +71,5 @@ final class GSDAddressMapper extends DataMapperAbstract
|
|||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $primaryField = 'Nummer';
|
||||
public const PRIMARYFIELD ='Nummer';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\Exchange\Interfaces\GSD\Model;
|
||||
|
||||
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||
|
||||
/**
|
||||
* Mapper class.
|
||||
|
|
@ -24,7 +24,7 @@ use phpOMS\DataStorage\Database\DataMapperAbstract;
|
|||
* @link https://orange-management.org
|
||||
* @since 1.0.0
|
||||
*/
|
||||
final class GSDArticleMapper extends DataMapperAbstract
|
||||
final class GSDArticleMapper extends DataMapperFactory
|
||||
{
|
||||
/**
|
||||
* Columns.
|
||||
|
|
@ -32,7 +32,7 @@ final class GSDArticleMapper extends DataMapperAbstract
|
|||
* @var array<string, array{name:string, type:string, internal:string, autocomplete?:bool, readonly?:bool, writeonly?:bool, annotations?:array}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static array $columns = [
|
||||
public const COLUMNS = [
|
||||
'row_id' => ['name' => 'row_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'row_create_time' => ['name' => 'row_create_time', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt'],
|
||||
'row_create_user' => ['name' => 'row_create_user', 'type' => 'int', 'internal' => 'createdBy'],
|
||||
|
|
@ -92,7 +92,7 @@ final class GSDArticleMapper extends DataMapperAbstract
|
|||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $table = 'Artikel';
|
||||
public const TABLE = 'Artikel';
|
||||
|
||||
/**
|
||||
* Created at.
|
||||
|
|
@ -100,7 +100,7 @@ final class GSDArticleMapper extends DataMapperAbstract
|
|||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $createdAt = 'row_create_time';
|
||||
public const CREATED_AT = 'row_create_time';
|
||||
|
||||
/**
|
||||
* Primary field name.
|
||||
|
|
@ -108,5 +108,5 @@ final class GSDArticleMapper extends DataMapperAbstract
|
|||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $primaryField = 'row_id';
|
||||
public const PRIMARYFIELD ='row_id';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\Exchange\Interfaces\GSD\Model;
|
||||
|
||||
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||
|
||||
/**
|
||||
* Mapper class.
|
||||
|
|
@ -24,7 +24,7 @@ use phpOMS\DataStorage\Database\DataMapperAbstract;
|
|||
* @link https://orange-management.org
|
||||
* @since 1.0.0
|
||||
*/
|
||||
final class GSDCostCenterMapper extends DataMapperAbstract
|
||||
final class GSDCostCenterMapper extends DataMapperFactory
|
||||
{
|
||||
/**
|
||||
* Columns.
|
||||
|
|
@ -32,7 +32,7 @@ final class GSDCostCenterMapper extends DataMapperAbstract
|
|||
* @var array<string, array{name:string, type:string, internal:string, autocomplete?:bool, readonly?:bool, writeonly?:bool, annotations?:array}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static array $columns = [
|
||||
public const COLUMNS = [
|
||||
'ROW_ID' => ['name' => 'ROW_ID', 'type' => 'int', 'internal' => 'id'],
|
||||
'row_create_time' => ['name' => 'row_create_time', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
|
||||
'row_create_user' => ['name' => 'row_create_user', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true],
|
||||
|
|
@ -46,7 +46,7 @@ final class GSDCostCenterMapper extends DataMapperAbstract
|
|||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $table = 'FiKostenstellen';
|
||||
public const TABLE = 'FiKostenstellen';
|
||||
|
||||
/**
|
||||
* Created at.
|
||||
|
|
@ -54,7 +54,7 @@ final class GSDCostCenterMapper extends DataMapperAbstract
|
|||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $createdAt = 'row_create_time';
|
||||
public const CREATED_AT = 'row_create_time';
|
||||
|
||||
/**
|
||||
* Primary field name.
|
||||
|
|
@ -62,5 +62,5 @@ final class GSDCostCenterMapper extends DataMapperAbstract
|
|||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $primaryField = 'ROW_ID';
|
||||
public const PRIMARYFIELD ='ROW_ID';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\Exchange\Interfaces\GSD\Model;
|
||||
|
||||
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||
|
||||
/**
|
||||
* Mapper class.
|
||||
|
|
@ -24,7 +24,7 @@ use phpOMS\DataStorage\Database\DataMapperAbstract;
|
|||
* @link https://orange-management.org
|
||||
* @since 1.0.0
|
||||
*/
|
||||
final class GSDCostObjectMapper extends DataMapperAbstract
|
||||
final class GSDCostObjectMapper extends DataMapperFactory
|
||||
{
|
||||
/**
|
||||
* Columns.
|
||||
|
|
@ -32,7 +32,7 @@ final class GSDCostObjectMapper extends DataMapperAbstract
|
|||
* @var array<string, array{name:string, type:string, internal:string, autocomplete?:bool, readonly?:bool, writeonly?:bool, annotations?:array}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static array $columns = [
|
||||
public const COLUMNS = [
|
||||
'ROW_ID' => ['name' => 'ROW_ID', 'type' => 'int', 'internal' => 'id'],
|
||||
'row_create_time' => ['name' => 'row_create_time', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
|
||||
'row_create_user' => ['name' => 'row_create_user', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true],
|
||||
|
|
@ -46,7 +46,7 @@ final class GSDCostObjectMapper extends DataMapperAbstract
|
|||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $table = 'FiKostentraeger';
|
||||
public const TABLE = 'FiKostentraeger';
|
||||
|
||||
/**
|
||||
* Created at.
|
||||
|
|
@ -54,7 +54,7 @@ final class GSDCostObjectMapper extends DataMapperAbstract
|
|||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $createdAt = 'row_create_time';
|
||||
public const CREATED_AT = 'row_create_time';
|
||||
|
||||
/**
|
||||
* Primary field name.
|
||||
|
|
@ -62,5 +62,5 @@ final class GSDCostObjectMapper extends DataMapperAbstract
|
|||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $primaryField = 'ROW_ID';
|
||||
public const PRIMARYFIELD ='ROW_ID';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\Exchange\Interfaces\GSD\Model;
|
||||
|
||||
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||
|
||||
/**
|
||||
* Mapper class.
|
||||
|
|
@ -24,7 +24,7 @@ use phpOMS\DataStorage\Database\DataMapperAbstract;
|
|||
* @link https://orange-management.org
|
||||
* @since 1.0.0
|
||||
*/
|
||||
final class GSDCustomerMapper extends DataMapperAbstract
|
||||
final class GSDCustomerMapper extends DataMapperFactory
|
||||
{
|
||||
/**
|
||||
* Columns.
|
||||
|
|
@ -32,7 +32,7 @@ final class GSDCustomerMapper extends DataMapperAbstract
|
|||
* @var array<string, array{name:string, type:string, internal:string, autocomplete?:bool, readonly?:bool, writeonly?:bool, annotations?:array}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static array $columns = [
|
||||
public const COLUMNS = [
|
||||
'row_id' => ['name' => 'row_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'row_create_time' => ['name' => 'row_create_time', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt'],
|
||||
'row_create_user' => ['name' => 'row_create_user', 'type' => 'int', 'internal' => 'createdBy'],
|
||||
|
|
@ -71,7 +71,7 @@ final class GSDCustomerMapper extends DataMapperAbstract
|
|||
* @var array<string, array{mapper:string, external:string, by?:string, column?:string, conditional?:bool}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static array $ownsOne = [
|
||||
public const OWNS_ONE = [
|
||||
'addr' => [
|
||||
'mapper' => GSDAddressMapper::class,
|
||||
'external' => 'AdressId',
|
||||
|
|
@ -84,7 +84,7 @@ final class GSDCustomerMapper extends DataMapperAbstract
|
|||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $table = 'Kunden';
|
||||
public const TABLE = 'Kunden';
|
||||
|
||||
/**
|
||||
* Created at.
|
||||
|
|
@ -92,7 +92,7 @@ final class GSDCustomerMapper extends DataMapperAbstract
|
|||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $createdAt = 'row_create_time';
|
||||
public const CREATED_AT = 'row_create_time';
|
||||
|
||||
/**
|
||||
* Primary field name.
|
||||
|
|
@ -100,5 +100,5 @@ final class GSDCustomerMapper extends DataMapperAbstract
|
|||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $primaryField = 'row_id';
|
||||
public const PRIMARYFIELD ='row_id';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\Exchange\Interfaces\GSD\Model;
|
||||
|
||||
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||
|
||||
/**
|
||||
* Mapper class.
|
||||
|
|
@ -24,7 +24,7 @@ use phpOMS\DataStorage\Database\DataMapperAbstract;
|
|||
* @link https://orange-management.org
|
||||
* @since 1.0.0
|
||||
*/
|
||||
final class GSDSupplierMapper extends DataMapperAbstract
|
||||
final class GSDSupplierMapper extends DataMapperFactory
|
||||
{
|
||||
/**
|
||||
* Columns.
|
||||
|
|
@ -32,7 +32,7 @@ final class GSDSupplierMapper extends DataMapperAbstract
|
|||
* @var array<string, array{name:string, type:string, internal:string, autocomplete?:bool, readonly?:bool, writeonly?:bool, annotations?:array}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static array $columns = [
|
||||
public const COLUMNS = [
|
||||
'row_id' => ['name' => 'row_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'row_create_time' => ['name' => 'row_create_time', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
|
||||
'row_create_user' => ['name' => 'row_create_user', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true],
|
||||
|
|
@ -51,7 +51,7 @@ final class GSDSupplierMapper extends DataMapperAbstract
|
|||
* @var array<string, array{mapper:string, external:string, by?:string, column?:string, conditional?:bool}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static array $ownsOne = [
|
||||
public const OWNS_ONE = [
|
||||
'addr' => [
|
||||
'mapper' => GSDAddressMapper::class,
|
||||
'external' => 'AdressId',
|
||||
|
|
@ -64,7 +64,7 @@ final class GSDSupplierMapper extends DataMapperAbstract
|
|||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $table = 'Lieferanten';
|
||||
public const TABLE = 'Lieferanten';
|
||||
|
||||
/**
|
||||
* Created at.
|
||||
|
|
@ -72,7 +72,7 @@ final class GSDSupplierMapper extends DataMapperAbstract
|
|||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $createdAt = 'row_create_time';
|
||||
public const CREATED_AT = 'row_create_time';
|
||||
|
||||
/**
|
||||
* Primary field name.
|
||||
|
|
@ -80,5 +80,5 @@ final class GSDSupplierMapper extends DataMapperAbstract
|
|||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $primaryField = 'row_id';
|
||||
public const PRIMARYFIELD ='row_id';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ declare(strict_types=1);
|
|||
namespace Modules\Exchange\Models;
|
||||
|
||||
use Modules\Admin\Models\AccountMapper;
|
||||
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||
|
||||
/**
|
||||
* Exchange log mapper class.
|
||||
|
|
@ -25,7 +25,7 @@ use phpOMS\DataStorage\Database\DataMapperAbstract;
|
|||
* @link https://orange-management.org
|
||||
* @since 1.0.0
|
||||
*/
|
||||
final class ExchangeLogMapper extends DataMapperAbstract
|
||||
final class ExchangeLogMapper extends DataMapperFactory
|
||||
{
|
||||
/**
|
||||
* Columns.
|
||||
|
|
@ -33,7 +33,7 @@ final class ExchangeLogMapper extends DataMapperAbstract
|
|||
* @var array<string, array{name:string, type:string, internal:string, autocomplete?:bool, readonly?:bool, writeonly?:bool, annotations?:array}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static array $columns = [
|
||||
public const COLUMNS = [
|
||||
'exchange_log_id' => ['name' => 'exchange_log_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'exchange_log_message' => ['name' => 'exchange_log_message', 'type' => 'string', 'internal' => 'message'],
|
||||
'exchange_log_fields' => ['name' => 'exchange_log_fields', 'type' => 'Json', 'internal' => 'fields'],
|
||||
|
|
@ -50,7 +50,7 @@ final class ExchangeLogMapper extends DataMapperAbstract
|
|||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $model = ExchangeLog::class;
|
||||
public const MODEL = ExchangeLog::class;
|
||||
|
||||
/**
|
||||
* Primary table.
|
||||
|
|
@ -58,7 +58,7 @@ final class ExchangeLogMapper extends DataMapperAbstract
|
|||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $table = 'exchange_log';
|
||||
public const TABLE = 'exchange_log';
|
||||
|
||||
/**
|
||||
* Primary field name.
|
||||
|
|
@ -66,7 +66,7 @@ final class ExchangeLogMapper extends DataMapperAbstract
|
|||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $primaryField = 'exchange_log_id';
|
||||
public const PRIMARYFIELD ='exchange_log_id';
|
||||
|
||||
/**
|
||||
* Belongs to.
|
||||
|
|
@ -74,7 +74,7 @@ final class ExchangeLogMapper extends DataMapperAbstract
|
|||
* @var array<string, array{mapper:string, external:string}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static array $belongsTo = [
|
||||
public const BELONGS_TO = [
|
||||
'createdBy' => [
|
||||
'mapper' => AccountMapper::class,
|
||||
'external' => 'exchange_log_created_by',
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\Exchange\Models;
|
||||
|
||||
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||
|
||||
/**
|
||||
* Mapper class.
|
||||
|
|
@ -24,7 +24,7 @@ use phpOMS\DataStorage\Database\DataMapperAbstract;
|
|||
* @link https://orange-management.org
|
||||
* @since 1.0.0
|
||||
*/
|
||||
final class InterfaceManagerMapper extends DataMapperAbstract
|
||||
final class InterfaceManagerMapper extends DataMapperFactory
|
||||
{
|
||||
/**
|
||||
* Columns.
|
||||
|
|
@ -32,7 +32,7 @@ final class InterfaceManagerMapper extends DataMapperAbstract
|
|||
* @var array<string, array{name:string, type:string, internal:string, autocomplete?:bool, readonly?:bool, writeonly?:bool, annotations?:array}>
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static array $columns = [
|
||||
public const COLUMNS = [
|
||||
'exchange_id' => ['name' => 'exchange_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'exchange_title' => ['name' => 'exchange_title', 'type' => 'string', 'internal' => 'info/name'],
|
||||
'exchange_path' => ['name' => 'exchange_path', 'type' => 'string', 'internal' => 'path'],
|
||||
|
|
@ -48,7 +48,7 @@ final class InterfaceManagerMapper extends DataMapperAbstract
|
|||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $table = 'exchange';
|
||||
public const TABLE = 'exchange';
|
||||
|
||||
/**
|
||||
* Primary field name.
|
||||
|
|
@ -56,5 +56,5 @@ final class InterfaceManagerMapper extends DataMapperAbstract
|
|||
* @var string
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected static string $primaryField = 'exchange_id';
|
||||
public const PRIMARYFIELD ='exchange_id';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ require_once __DIR__ . '/../vendor/autoload.php';
|
|||
require_once __DIR__ . '/Autoloader.php';
|
||||
|
||||
use phpOMS\DataStorage\Database\DatabasePool;
|
||||
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||
use phpOMS\DataStorage\Session\HttpSession;
|
||||
|
||||
$CONFIG = [
|
||||
|
|
@ -329,7 +329,7 @@ $GLOBALS['dbpool']->create('delete', $CONFIG['db']['core']['masters']['delete'])
|
|||
$GLOBALS['dbpool']->create('insert', $CONFIG['db']['core']['masters']['insert']);
|
||||
$GLOBALS['dbpool']->create('schema', $CONFIG['db']['core']['masters']['schema']);
|
||||
|
||||
DataMapperAbstract::setConnection($GLOBALS['dbpool']->get());
|
||||
DataMapperFactory::db($GLOBALS['dbpool']->get());
|
||||
|
||||
$GLOBALS['frameworkpath'] = '/phpOMS/';
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user