Prevent deleting a list if attached to a form
[MAILPOET-3661]
This commit is contained in:
@@ -27,6 +27,20 @@ class FormsRepository extends Repository {
|
||||
->getResult();
|
||||
}
|
||||
|
||||
public function getNamesOfFormsForSegments(): array {
|
||||
$allNonDeletedForms = $this->findAllNotDeleted();
|
||||
|
||||
$nameMap = [];
|
||||
foreach ($allNonDeletedForms as $form) {
|
||||
$blockSegmentsIds = $form->getSettingsSegmentIds();
|
||||
foreach ($blockSegmentsIds as $blockSegmentId) {
|
||||
$nameMap[(string)$blockSegmentId][] = $form->getName();
|
||||
}
|
||||
}
|
||||
|
||||
return $nameMap;
|
||||
}
|
||||
|
||||
public function count(): int {
|
||||
return (int)$this->doctrineRepository
|
||||
->createQueryBuilder('f')
|
||||
|
Reference in New Issue
Block a user