photo settings
This commit is contained in:
1 parent
567ab8544d
commit
a1bed2d9f2
9 files changed
+125
-78
No files matched your search
@@ -249,4 +249,31 @@ class EntityRelation
|
||||
|
||||
return $entities;
|
||||
}
|
||||
|
||||
public static function configurationEntitiesByProperty(array|null $entities, string $property): void
|
||||
{
|
||||
$entityRelations = self::getEntitiesRelations();
|
||||
if (isset($entities)) {
|
||||
foreach ($entities as $entity) {
|
||||
if (!isset($entityRelations[$entity])) {
|
||||
EntityRelation::addEntityRelation($entity, $property);
|
||||
}
|
||||
}
|
||||
foreach ($entityRelations as $entity => $additionalProperty) {
|
||||
if (in_array($entity, $entities)) {
|
||||
if (!in_array($property, $additionalProperty)) {
|
||||
EntityRelation::addEntityRelation($entity, $property);
|
||||
}
|
||||
} else {
|
||||
if (in_array($property, $additionalProperty)) {
|
||||
EntityRelation::removePropertyFromEntityRelations($entity, $property);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach ($entityRelations as $entity => $additionalProperty) {
|
||||
EntityRelation::removePropertyFromEntityRelations($entity, $property);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user