// Replace shop->addSqlRestriction() and shop->addSqlRestrictionOnLang() by static versions

This commit is contained in:
rMalie
2012-02-27 12:15:30 +00:00
parent 6f10f8fb12
commit 0a3fa7ba14
58 changed files with 210 additions and 241 deletions
+5 -3
View File
@@ -696,7 +696,7 @@ class ShopCore extends ObjectModel
* @param string $alias
* @param string $type shop|group_shop
*/
public function addSqlRestriction($share = false, $alias = null, $type = 'shop')
public static function addSqlRestriction($share = false, $alias = null, $type = 'shop')
{
if ($type != 'shop' && $type != 'group_shop')
$type = 'shop';
@@ -753,9 +753,11 @@ class ShopCore extends ObjectModel
* @param Context $context
* @return string
*/
public function addSqlRestrictionOnLang($alias = null)
public static function addSqlRestrictionOnLang($alias = null, $id_shop = null)
{
return ' AND '.(($alias) ? $alias.'.' : '').'id_shop = '.$this->id.' ';
if (is_null($id_shop))
$id_shop = Context::getContext()->shop->id;
return ' AND '.(($alias) ? $alias.'.' : '').'id_shop = '.$id_shop.' ';
}
/**