// Merge -> revision 7875

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7877 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2011-08-03 16:16:49 +00:00
parent 6f08bcb12e
commit f2b5ee338b
38 changed files with 320 additions and 85 deletions

View File

@@ -117,7 +117,7 @@ abstract class ObjectModelCore
if ($id_lang != NULL && Validate::isLoadedObject(new Language($id_lang)))
$this->id_lang = $id_lang;
elseif ($id_lang != NULL)
die(Tools::displayError());
$this->id_lang = Configuration::get('PS_LANG_DEFAULT');
if ($id_shop && $this->langMultiShop)
{
@@ -853,4 +853,20 @@ abstract class ObjectModelCore
return false;
return true;
}
/**
* Specify if an ObjectModel is already in database
*
* @param $id_entity entity id
* @return boolean
*/
public static function existsInDatabase($id_entity)
{
$row = Db::getInstance()->getRow('
SELECT `id_'.self::$table.'`
FROM `'._DB_PREFIX_.self::$table.'` e
WHERE e.`id_'.self::$table.'` = '.(int)($id_entity));
return isset($row['id_product']);
}
}