first impl of event (WIP)

This commit is contained in:
2022-02-11 10:31:17 +01:00
parent f2221565c5
commit 441704dc29
5 changed files with 330 additions and 6 deletions

View File

@@ -12,17 +12,25 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Household;
use Chill\PersonBundle\Entity\Household\Household;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Validator\Validator\ValidatorInterface;
class MembersEditorFactory
{
public function __construct(ValidatorInterface $validator)
{
private EventDispatcherInterface $eventDispatcher;
private ValidatorInterface $validator;
public function __construct(
EventDispatcherInterface $eventDispatcher,
ValidatorInterface $validator
) {
$this->validator = $validator;
$this->eventDispatcher = $eventDispatcher;
}
public function createEditor(?Household $household = null): MembersEditor
{
return new MembersEditor($this->validator, $household);
return new MembersEditor($this->validator, $household, $this->eventDispatcher);
}
}