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

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13618 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2012-02-27 12:15:30 +00:00
parent 2caf013a0f
commit c2cef61a5a
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.' ';
}
/**