murph-core/src/core/Event/Page/PageEditEvent.php

43 lines
812 B
PHP
Raw Normal View History

2022-03-13 19:32:32 +01:00
<?php
namespace App\Core\Event\Page;
use App\Core\Entity\Site\Page\Page;
2023-10-12 16:15:07 +02:00
use Symfony\Contracts\EventDispatcher\Event;
2022-03-13 19:32:32 +01:00
/**
* class PageEditEvent.
*
* @author Simon Vieille <simon@deblan.fr>
*/
class PageEditEvent extends Event
{
2023-10-12 16:15:07 +02:00
public const FORM_INIT_EVENT = 'page_edit_event.form_init';
2022-03-13 19:32:32 +01:00
protected array $pageBuilderOptions = [];
public function __construct(protected Page $page)
2022-03-13 19:32:32 +01:00
{
}
public function getPage()
{
return $this->page;
}
public function getPageBuilderOptions(): array
{
return $this->pageBuilderOptions;
}
public function addPageBuilderOptions(array $options): self
{
$this->pageBuilderOptions = array_merge(
$this->pageBuilderOptions,
$options
);
return $this;
}
}