mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 23:13:15 +00:00
Get collections by private fields & filter collections by user rights
This commit is contained in:

committed by
Benoît Burnichon

parent
801314bf59
commit
4157d14d1b
@@ -103,4 +103,22 @@ class Structure
|
||||
|
||||
throw new DomainException(sprintf('Unknown field "%s".', $name));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of collections indexed by field name.
|
||||
*
|
||||
* [
|
||||
* "FieldName" => [1, 4, 5],
|
||||
* "OtherFieldName" => [4],
|
||||
* ]
|
||||
*/
|
||||
public function getCollectionsUsedByPrivateFields()
|
||||
{
|
||||
$map = [];
|
||||
foreach ($this->private as $name => $field) {
|
||||
$map[$name] = $field->getDependantCollections();
|
||||
}
|
||||
|
||||
return $map;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user