Michael RICOIS e1254b6561 Order By
2017-09-11 17:23:15 +02:00

31 lines
969 B
PHP

<?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.' ORDER BY `name` ASC');
}
}