This commit is contained in:
Benoît Burnichon
2016-03-17 18:00:58 +01:00
parent 9398891f5c
commit f07b7b6722
5 changed files with 174 additions and 32 deletions

View File

@@ -1761,11 +1761,11 @@ class ACL implements cache_cacheableInterface
}
/**
* Returns an array of collections on which the user is 'order master'
* Returns base ids on which user is 'order master'
*
* @return collection[]
* @return array
*/
public function get_order_master_collections()
public function getOrderMasterCollectionsBaseIds()
{
$sql = 'SELECT base_id FROM basusr WHERE order_master="1" AND usr_id= :usr_id';
$result = $this->app->getApplicationBox()
@@ -1780,6 +1780,18 @@ class ACL implements cache_cacheableInterface
$baseIds[] = $item['base_id'];
}
return $baseIds;
}
/**
* Returns an array of collections on which the user is 'order master'
*
* @return collection[]
*/
public function get_order_master_collections()
{
$baseIds = $this->getOrderMasterCollectionsBaseIds();
$groups = [];
foreach ($this->app['repo.collection-references']->findHavingOrderMaster($baseIds) as $index => $reference) {