// Fix bug on auths for sub employees #PSFV-849

This commit is contained in:
rMalie
2012-04-23 09:38:24 +00:00
parent 64a05103a6
commit 22daabf9cb
7 changed files with 104 additions and 80 deletions

View File

@@ -1076,6 +1076,24 @@ abstract class ObjectModelCore
return true;
}
/**
* Get the list of associated id_shop
*
* @since 1.5.0
* @return array
*/
public function getAssociatedShops()
{
if (!Shop::isTableAssociated($this->def['table']))
return array();
$list = array();
$sql = 'SELECT id_shop FROM `'._DB_PREFIX_.$this->def['table'].'_shop` WHERE `'.$this->def['primary'].'` = '.(int)$this->id;
foreach (Db::getInstance()->executeS($sql) as $row)
$list[] = $row['id_shop'];
return $list;
}
/**
* @since 1.5.0
*/