Get collections by private fields & filter collections by user rights

This commit is contained in:
Mathieu Darse
2015-06-29 15:25:36 +02:00
committed by Benoît Burnichon
parent 801314bf59
commit 4157d14d1b
5 changed files with 75 additions and 25 deletions

View File

@@ -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;
}
}