51 lines
1.3 KiB
PHP
51 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace KupShop\ComponentsBundle\Attributes;
|
|
|
|
use KupShop\ContentBundle\Util\BlocekTypes;
|
|
|
|
#[\Attribute(\Attribute::TARGET_PROPERTY)]
|
|
class BlocekAttribute
|
|
{
|
|
/**
|
|
* @param mixed|null $default Default value inserted into the parameter setting
|
|
* @param string|null $title Name used in the Blocek
|
|
* @param BlocekTypes|null $type Overrides the default type that is taken from the parameter type
|
|
* @param array|string|null $options Value used in SELECT type
|
|
*/
|
|
public function __construct(
|
|
protected mixed $default = null,
|
|
protected ?string $title = null,
|
|
protected ?BlocekTypes $type = null,
|
|
protected array|string|null $options = null,
|
|
protected ?string $autocompleteType = null,
|
|
protected ?bool $autocompleteMulti = null,
|
|
protected ?string $autocompletePreload = null,
|
|
protected ?bool $autocompleteInvert = null,
|
|
protected ?bool $autocompleteSortable = null,
|
|
) {
|
|
}
|
|
|
|
public function getDefault(): ?bool
|
|
{
|
|
return $this->default;
|
|
}
|
|
|
|
public function getTitle(): ?string
|
|
{
|
|
return $this->title;
|
|
}
|
|
|
|
public function getType(): ?BlocekTypes
|
|
{
|
|
return $this->type;
|
|
}
|
|
|
|
public function getOptions(): ?array
|
|
{
|
|
return $this->options;
|
|
}
|
|
}
|