Skip to content

Commit

Permalink
Remove PageFormMapper
Browse files Browse the repository at this point in the history
  • Loading branch information
jordisala1991 committed Aug 12, 2022
1 parent 28f87f0 commit eb43569
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 83 deletions.
7 changes: 2 additions & 5 deletions src/Admin/BlockAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
use Sonata\BlockBundle\Block\Service\EditableBlockService;
use Sonata\BlockBundle\Form\Type\ServiceListType;
use Sonata\BlockBundle\Model\BlockInterface;
use Sonata\PageBundle\Mapper\PageFormMapper;
use Sonata\PageBundle\Model\PageBlockInterface;
use Sonata\PageBundle\Model\PageInterface;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
Expand Down Expand Up @@ -232,12 +231,10 @@ private function configureBlockFields(FormMapper $form, BlockInterface $block):
));
}

$blockMapper = new PageFormMapper($form);

if ($block->getId() > 0) {
$service->configureEditForm($blockMapper, $block);
$service->configureEditForm($form, $block);
} else {
$service->configureCreateForm($blockMapper, $block);
$service->configureCreateForm($form, $block);
}

if ($form->has('settings') && isset($this->blocks[$blockType]['templates'])) {
Expand Down
7 changes: 2 additions & 5 deletions src/Admin/SharedBlockAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use Sonata\BlockBundle\Block\Service\EditableBlockService;
use Sonata\BlockBundle\Model\BlockInterface;
use Sonata\DoctrineORMAdminBundle\Datagrid\ProxyQuery;
use Sonata\PageBundle\Mapper\PageFormMapper;
use Sonata\PageBundle\Model\PageBlockInterface;

/**
Expand Down Expand Up @@ -103,12 +102,10 @@ private function configureBlockFields(FormMapper $form, BlockInterface $block):
));
}

$blockMapper = new PageFormMapper($form);

if ($block->getId() > 0) {
$service->configureEditForm($blockMapper, $block);
$service->configureEditForm($form, $block);
} else {
$service->configureCreateForm($blockMapper, $block);
$service->configureCreateForm($form, $block);
}
}
}
73 changes: 0 additions & 73 deletions src/Mapper/PageFormMapper.php

This file was deleted.

0 comments on commit eb43569

Please sign in to comment.