2017-06-08 12:23:50 +02:00
|
|
|
<?php
|
|
|
|
class ProductConfiguratorOptImpact extends ObjectModel
|
|
|
|
{
|
|
|
|
public $id_product_configurator_opt_impact;
|
|
|
|
public $id_product;
|
|
|
|
public $id_product_configurator_opt_group;
|
|
|
|
public $id_configurator_opt;
|
|
|
|
public $price;
|
|
|
|
|
|
|
|
public static $definition = array(
|
|
|
|
'table' => 'product_configurator_opt_impact',
|
|
|
|
'primary' => 'id_product_configurator_opt_impact',
|
|
|
|
'multilang' => false,
|
|
|
|
'fields' => array(
|
|
|
|
'id_product' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
|
|
|
'id_product_configurator_opt_group' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
|
|
|
'id_configurator_opt' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
|
|
|
'price' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'required' => true),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
|
|
|
|
public static function getProductOptImpact($id_product)
|
|
|
|
{
|
|
|
|
$result = Db::getInstance()->executeS('
|
2017-06-30 15:08:11 +02:00
|
|
|
SELECT pcoi.*, co.*, col.`name` FROM `'._DB_PREFIX_.'product_configurator_opt_impact` pcoi, `'._DB_PREFIX_.'configurator_opt` co
|
|
|
|
LEFT JOIN `'._DB_PREFIX_.'configurator_opt_lang` col ON (col.`id_configurator_opt` = co.`id_configurator_opt` AND col.`id_lang` = 1)
|
|
|
|
WHERE pcoi.`id_product` = '.(int)$id_product.' AND pcoi.`id_configurator_opt` = co.`id_configurator_opt`
|
2017-06-08 12:23:50 +02:00
|
|
|
ORDER BY position ASC');
|
|
|
|
|
|
|
|
return $result;
|
|
|
|
}
|
|
|
|
}
|