54 lines
2.0 KiB
PHP
54 lines
2.0 KiB
PHP
<?php
|
|
/**
|
|
* NOTICE OF LICENSE
|
|
*
|
|
* This source file is subject to a commercial license from Common-Services Co., Ltd.
|
|
* Use, copy, modification or distribution of this source file without written
|
|
* license agreement from the SARL SMC is strictly forbidden.
|
|
* In order to obtain a license, please contact us: contact@common-services.com
|
|
* ...........................................................................
|
|
* INFORMATION SUR LA LICENCE D'UTILISATION
|
|
*
|
|
* L'utilisation de ce fichier source est soumise a une licence commerciale
|
|
* concedee par la societe Common-Services Co., Ltd.
|
|
* Toute utilisation, reproduction, modification ou distribution du present
|
|
* fichier source sans contrat de licence ecrit de la part de la Common-Services Co. Ltd. est
|
|
* expressement interdite.
|
|
* Pour obtenir une licence, veuillez contacter Common-Services Co., Ltd. a l'adresse: contact@common-services.com
|
|
* ...........................................................................
|
|
*
|
|
* @package soflexibilite
|
|
* @author Alexandre D.
|
|
* @copyright Copyright (c) 2011-2015 Common Services Co Ltd - 90/25 Sukhumvit 81 - 10260 Bangkok - Thailand
|
|
* @license Commercial license
|
|
* Support by mail : support.soflexibilite@common-services.com
|
|
*/
|
|
|
|
class SoFlexibiliteGroup extends Group
|
|
{
|
|
|
|
public static function setColissimoGroups($id_carrier, $id_lang = null)
|
|
{
|
|
if (!$id_lang) {
|
|
$id_lang = (int)Configuration::get('PS_LANG_DEFAULT');
|
|
}
|
|
|
|
$groups = self::getGroups((int)$id_lang);
|
|
|
|
foreach ($groups as $group) {
|
|
$table = 'carrier_group';
|
|
$values = array(
|
|
'id_carrier' => (int)$id_carrier,
|
|
'id_group' => (int)$group['id_group']
|
|
);
|
|
|
|
if (version_compare(_PS_VERSION_, '1.5', '>=')) {
|
|
Db::getInstance()->insert($table, $values);
|
|
} else {
|
|
Db::getInstance()->autoExecute(_DB_PREFIX_.$table, $values, 'INSERT');
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|