photo settings
This commit is contained in:
@ -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