-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
77 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\ContentForms\Event; | ||
|
||
use Ibexa\Contracts\ContentForms\Data\Content\FieldData; | ||
use Symfony\Component\Form\FormInterface; | ||
use Symfony\Contracts\EventDispatcher\Event; | ||
|
||
abstract class UserStructFieldOptionsEvent extends Event | ||
{ | ||
/** @var \Symfony\Component\Form\FormInterface */ | ||
protected $parentForm; | ||
|
||
/** @var \Ibexa\Contracts\ContentForms\Data\Content\FieldData */ | ||
protected $fieldData; | ||
|
||
/** @var array<string, mixed> */ | ||
protected $options; | ||
|
||
public function __construct( | ||
FormInterface $parentForm, | ||
FieldData $fieldData, | ||
array $options | ||
) { | ||
$this->parentForm = $parentForm; | ||
$this->fieldData = $fieldData; | ||
$this->options = $options; | ||
} | ||
|
||
public function getParentForm(): FormInterface | ||
{ | ||
return $this->parentForm; | ||
} | ||
|
||
public function getFieldData(): FieldData | ||
{ | ||
return $this->fieldData; | ||
} | ||
|
||
/** | ||
* @return array<string, mixed> | ||
*/ | ||
public function getOptions(): array | ||
{ | ||
return $this->options; | ||
} | ||
|
||
/** | ||
* @param array<string, mixed> $options | ||
*/ | ||
public function setOptions(array $options): void | ||
{ | ||
$this->options = $options; | ||
} | ||
|
||
public function setOption(string $option, $value): void | ||
{ | ||
$this->options[$option] = $value; | ||
} | ||
|
||
public function getOption(string $option) | ||
{ | ||
return $this->options[$option] ?? null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters