add empik module
This commit is contained in:
60
modules/empikmarketplace/src/Entity/EmpikAction.php
Normal file
60
modules/empikmarketplace/src/Entity/EmpikAction.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
|
||||
class EmpikAction extends ObjectModel
|
||||
{
|
||||
const ACTION_OTHER = 'OTHER';
|
||||
const ACTION_PRODUCT_EXPORT = 'PRODUCT_EXPORT';
|
||||
const ACTION_OFFER_EXPORT = 'OFFER_EXPORT';
|
||||
const ACTION_PRODUCT_EXPORT_INCLUDE = 'PRODUCT_EXPORT_INCLUDE';
|
||||
const ACTION_PRODUCT_EXPORT_EXCLUDE = 'PRODUCT_EXPORT_EXCLUDE';
|
||||
|
||||
const STATUS_NEW = 'NEW';
|
||||
const STATUS_COMPLETED = 'COMPLETE';
|
||||
|
||||
public $id_shop;
|
||||
public $action = self::ACTION_OTHER;
|
||||
public $status = self::STATUS_NEW;
|
||||
public $id_import;
|
||||
public $import_count;
|
||||
public $date_start;
|
||||
public $date_end;
|
||||
|
||||
public static $definition = [
|
||||
'table' => 'empik_action',
|
||||
'primary' => 'id_empik_action',
|
||||
'fields' => [
|
||||
'id_shop' => [
|
||||
'type' => self::TYPE_INT,
|
||||
'validate' => 'isUnsignedInt',
|
||||
'required' => true,
|
||||
],
|
||||
'action' => [
|
||||
'type' => self::TYPE_STRING,
|
||||
'validate' => 'isCleanHtml',
|
||||
],
|
||||
'status' => [
|
||||
'type' => self::TYPE_STRING,
|
||||
'validate' => 'isCleanHtml',
|
||||
],
|
||||
'id_import' => [
|
||||
'type' => self::TYPE_INT,
|
||||
'validate' => 'isCleanHtml',
|
||||
],
|
||||
'import_count' => [
|
||||
'type' => self::TYPE_INT,
|
||||
'validate' => 'isCleanHtml',
|
||||
],
|
||||
'date_start' => [
|
||||
'type' => self::TYPE_DATE,
|
||||
'validate' => 'isDate',
|
||||
'required' => true,
|
||||
],
|
||||
'date_end' => [
|
||||
'type' => self::TYPE_DATE,
|
||||
'validate' => 'isDate',
|
||||
'required' => true,
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
30
modules/empikmarketplace/src/Entity/EmpikActionLog.php
Normal file
30
modules/empikmarketplace/src/Entity/EmpikActionLog.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
|
||||
class EmpikActionLog extends ObjectModel
|
||||
{
|
||||
public $id_empik_action;
|
||||
public $message;
|
||||
public $date_add;
|
||||
|
||||
public static $definition = [
|
||||
'table' => 'empik_action',
|
||||
'primary' => 'id_empik_action_log',
|
||||
'fields' => [
|
||||
'id_empik_action' => [
|
||||
'type' => self::TYPE_INT,
|
||||
'validate' => 'isUnsignedInt',
|
||||
'required' => true,
|
||||
],
|
||||
'message' => [
|
||||
'type' => self::TYPE_STRING,
|
||||
'validate' => 'isCleanHtml',
|
||||
],
|
||||
'date_add' => [
|
||||
'type' => self::TYPE_DATE,
|
||||
'validate' => 'isDate',
|
||||
'required' => true,
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
87
modules/empikmarketplace/src/Entity/EmpikOrder.php
Normal file
87
modules/empikmarketplace/src/Entity/EmpikOrder.php
Normal file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
|
||||
class EmpikOrder extends ObjectModel
|
||||
{
|
||||
public $id_order;
|
||||
public $empik_order_reference;
|
||||
public $empik_order_carrier;
|
||||
public $empik_payment;
|
||||
public $empik_carrier;
|
||||
public $empik_pickup_point;
|
||||
public $empik_vat_number;
|
||||
public $date_add;
|
||||
|
||||
public static $definition = [
|
||||
'table' => 'empik_orders',
|
||||
'primary' => 'id_empik_order',
|
||||
'fields' => [
|
||||
'id_order' => [
|
||||
'type' => self::TYPE_INT,
|
||||
'validate' => 'isUnsignedInt',
|
||||
'required' => true,
|
||||
],
|
||||
'empik_order_reference' => [
|
||||
'type' => self::TYPE_STRING,
|
||||
'validate' => 'isCleanHtml',
|
||||
],
|
||||
'empik_order_carrier' => [
|
||||
'type' => self::TYPE_STRING,
|
||||
'validate' => 'isCleanHtml',
|
||||
],
|
||||
'empik_payment' => [
|
||||
'type' => self::TYPE_STRING,
|
||||
'validate' => 'isCleanHtml',
|
||||
'required' => true,
|
||||
],
|
||||
'empik_carrier' => [
|
||||
'type' => self::TYPE_STRING,
|
||||
'validate' => 'isCleanHtml',
|
||||
'required' => true,
|
||||
],
|
||||
'empik_pickup_point' => [
|
||||
'type' => self::TYPE_STRING,
|
||||
'validate' => 'isCleanHtml',
|
||||
],
|
||||
'empik_vat_number' => [
|
||||
'type' => self::TYPE_STRING,
|
||||
'validate' => 'isCleanHtml',
|
||||
],
|
||||
'date_add' => [
|
||||
'type' => self::TYPE_DATE,
|
||||
'validate' => 'isDate',
|
||||
'required' => false,
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
public static function getEmpikOrderByOrderId($orderId)
|
||||
{
|
||||
$query = (new DbQuery())
|
||||
->select('eo.*')
|
||||
->from('empik_orders', 'eo')
|
||||
->where('eo.id_order = "'.pSQL($orderId).'"');
|
||||
|
||||
return Db::getInstance()->getRow($query);
|
||||
}
|
||||
|
||||
public static function getEmpikOrderReferenceByOrderId($orderId)
|
||||
{
|
||||
$query = (new DbQuery())
|
||||
->select('eo.empik_order_reference')
|
||||
->from('empik_orders', 'eo')
|
||||
->where('eo.id_order = "'.pSQL($orderId).'"');
|
||||
|
||||
return Db::getInstance()->getValue($query);
|
||||
}
|
||||
|
||||
public static function getOrderIdByEmpikOrderReference($empikOrderReference)
|
||||
{
|
||||
$query = (new DbQuery())
|
||||
->select('eo.id_order')
|
||||
->from('empik_orders', 'eo')
|
||||
->where('eo.empik_order_reference = "'.pSQL($empikOrderReference).'"');
|
||||
|
||||
return Db::getInstance()->getValue($query);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user