Serveur preprod f0c0c48223 first push
2016-04-14 16:14:31 +02:00

47 lines
1.3 KiB
PHP

<?php
class PrivateSalesExport extends ObjectModel
{
public $id_privatesales_export;
public $id_sale;
public $status;
public $from;
public $to;
public $date_add;
public static $definition = array(
'table' => 'privatesales_logistique_export',
'primary' => 'id_privatesales_export',
'fields' => array(
'id_sale' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
'status' => array('type' => self::TYPE_STRING, 'validate' => 'isString'),
'from' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
'to' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
)
);
public function __construct($id = null, $id_lang = null, $id_shop = null)
{
parent::__construct($id, $id_lang, $id_shop);
}
public static function getDir($root = true)
{
if($root === true)
return _PS_MODULE_DIR_.'privatesales_tools/files/bdc/';
else
return Context::getContext()->shop->getBaseUrl().'modules/privatesales_tools/files/bdc/';
}
public static function getFileStatic($id_privatesales_export, $root)
{
return self::getDir($root).$id_privatesales_export.'.xlsx';
}
public function getFile($root = true)
{
return self::getFileStatic($this->id, $root);
}
}
?>