30 lines
934 B
PHP
Raw Normal View History

2017-06-20 11:11:51 +02:00
<?php
class Simulator extends ObjectModel
{
public $id_simulator;
public $code;
public $name;
public static $definition = array(
'table' => 'simulator', 'primary' => 'id_simulator', 'multilang' => false,
'fields' => array(
'code' => array('type' => self::TYPE_STRING),
'name' => array('type' => self::TYPE_STRING),
),
);
public static function getFromProduct($id_product)
{
return Db::getInstance()->getValue('SELECT `id_simulator` FROM `'._DB_PREFIX_.'product` WHERE id_product = '.(int)$id_product);
}
public static function getAll()
{
return Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'simulator`');
}
public function getThemes()
{
return Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'simulator_theme` WHERE id_simulator = '.(int)$this->id_simulator);
}
}