* @copyright 2015-2020 Garamo Online L.T.D * @license Commercial license */ class Rc_PgAnalyticsOrderSent extends ObjectModel { public $id_order; public $id_shop; public $sent_from; public $sent_at; public static $definition = array( 'table' => 'rc_pganalytics_orders_sent', 'primary' => 'id_order', 'fields' => array( 'id_order' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'sent_from' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true), 'sent_at' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'required' => true), ) ); public static function getOrderReport($id_order, $id_shop) { $query = 'SELECT * FROM `'._DB_PREFIX_.'rc_pganalytics_orders_sent` WHERE id_order = '.(int)$id_order.' AND id_shop = '.(int)$id_shop ; return Db::getInstance()->getRow($query); } public static function removeOrder($id_order, $id_shop) { $query = 'DELETE FROM `'._DB_PREFIX_.'rc_pganalytics_orders_sent` WHERE id_order = '.(int)$id_order.' AND id_shop = '.(int)$id_shop ; return Db::getInstance()->execute($query); } }