71 lines
2.1 KiB
PHP
71 lines
2.1 KiB
PHP
<?php
|
|
/**
|
|
* NOTICE OF LICENSE
|
|
*
|
|
* This source file is subject to a commercial license.
|
|
* Use, copy, modification or distribution of this source file without written
|
|
* license agreement is strictly forbidden.
|
|
* In order to obtain a license, please contact us: simon@daig.re
|
|
* ...........................................................................
|
|
* INFORMATION SUR LA LICENCE D'UTILISATION
|
|
*
|
|
* L'utilisation de ce fichier source est soumise a une licence commerciale.
|
|
* Toute utilisation, reproduction, modification ou distribution du present
|
|
* fichier source sans contrat de licence ecrit est expressement interdite.
|
|
* Pour obtenir une licence, veuillez nous contacter a l'adresse: simon@daig.re
|
|
*
|
|
* @package La Poste Colissimo Relay
|
|
* @author Agencya
|
|
* @copyright Copyright(c) 2015-2018
|
|
* @license See Readme.md
|
|
* Contact by Email : simon@daig.re
|
|
*/
|
|
|
|
require_once(dirname(__FILE__).'/../classes/Colissimo_Autoload.php');
|
|
|
|
/**
|
|
* Class ColissimoPickup
|
|
*/
|
|
class ColissimoPickup extends ObjectModel
|
|
{
|
|
/** @var int */
|
|
public $id_cart;
|
|
|
|
/** @var int */
|
|
public $id_point_pickup;
|
|
|
|
/** @var DateTime */
|
|
public $date_add;
|
|
|
|
/* @var DateTime */
|
|
public $date_upd;
|
|
|
|
/**
|
|
* @var array
|
|
*/
|
|
public static $definition = array(
|
|
'table' => 'colissimo_pickup',
|
|
'primary' => 'id_pickup',
|
|
'multilang' => false,
|
|
'fields' => array(
|
|
'id_cart' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
|
'id_point_pickup' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
|
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
|
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
|
|
),
|
|
);
|
|
|
|
/**
|
|
* @param int $id_cart
|
|
* @return mixed
|
|
*/
|
|
public static function getIdByCartId($id_cart)
|
|
{
|
|
return Db::getInstance()->getValue('
|
|
SELECT csp.`id_pickup`
|
|
FROM `'._DB_PREFIX_.'colissimo_pickup` csp
|
|
WHERE csp.`id_cart` = '.(int)$id_cart
|
|
);
|
|
}
|
|
}
|