'htl_image_category', 'primary' => 'id_htl_image_category', 'multilang' => true, 'fields' => array( 'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCatalogName', 'required' => true, 'size' => 128), 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false), 'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false), ), ); public static function getImageCategories($idLang = null) { if (!$idLang) { $idLang = (int) Context::getContext()->language->id; } $defaultLangId = (int) Configuration::get('PS_LANG_DEFAULT'); return Db::getInstance()->executeS( 'SELECT hic.`id_htl_image_category`, COALESCE(hicl.`name`, hiclDefault.`name`) AS `name` FROM `'._DB_PREFIX_.'htl_image_category` hic LEFT JOIN `'._DB_PREFIX_.'htl_image_category_lang` hicl ON (hicl.`id_htl_image_category` = hic.`id_htl_image_category` AND hicl.`id_lang` = '.(int) $idLang.') LEFT JOIN `'._DB_PREFIX_.'htl_image_category_lang` hiclDefault ON (hiclDefault.`id_htl_image_category` = hic.`id_htl_image_category` AND hiclDefault.`id_lang` = '.(int) $defaultLangId.') WHERE COALESCE(hicl.`name`, hiclDefault.`name`) IS NOT NULL ORDER BY `name` ASC' ); } }