added section name for meta-fields positioning (#5747)

This commit is contained in:
Kevin Papst
2025-12-26 12:54:15 +01:00
committed by GitHub
parent 26361da873
commit 5a0c783a76
10 changed files with 101 additions and 52 deletions

View File

@@ -12,8 +12,8 @@ namespace App\Entity;
use Doctrine\Common\Collections\Collection;
/**
* @method getTags() array
* @method getBreak() int
* @method array<Tag> getTags()
* @method int getBreak()
*/
interface ExportableItem
{

View File

@@ -11,6 +11,10 @@ namespace App\Entity;
use Symfony\Component\Validator\Constraint;
/**
* @method null|string getSection()
* @method void setSection(?string $name)
*/
interface MetaTableTypeInterface
{
/**
@@ -43,6 +47,8 @@ interface MetaTableTypeInterface
/**
* This will merge the current object with the values from the given $meta instance.
* It should NOT update the name or value, but only the form settings.
*
* Settings from the given $meta object will win over the current ones.
*/
public function merge(MetaTableTypeInterface $meta): MetaTableTypeInterface;
@@ -132,6 +138,16 @@ interface MetaTableTypeInterface
*/
public function getOrder(): int;
/**
* FIXME activate with 3.0
*/
//public function setSection(?string $section): void;
/**
* FIXME activate with 3.0
*/
//public function getSection(): ?string;
/**
* Whether true if this field is defined by a plugin, or false if it is a value stored in the database.
*/

View File

@@ -67,6 +67,7 @@ trait MetaTableTypeTrait
*/
private mixed $data = null;
private bool $updated = false;
private ?string $section = null;
public function getName(): ?string
{
@@ -193,13 +194,11 @@ trait MetaTableTypeTrait
public function merge(MetaTableTypeInterface $meta): MetaTableTypeInterface
{
$this
->setConstraints($meta->getConstraints())
->setIsRequired($meta->isRequired())
->setIsVisible($meta->isVisible())
->setOptions($meta->getOptions())
->setOrder($meta->getOrder())
;
$this->setConstraints($meta->getConstraints());
$this->setIsRequired($meta->isRequired());
$this->setIsVisible($meta->isVisible());
$this->setOptions($meta->getOptions());
$this->setOrder($meta->getOrder());
if ($meta->getLabel() !== null) {
$this->setLabel($meta->getLabel());
@@ -209,6 +208,10 @@ trait MetaTableTypeTrait
$this->setType($meta->getType());
}
if ($meta->getSection() !== null) {
$this->setSection($meta->getSection());
}
return $this;
}
@@ -266,6 +269,16 @@ trait MetaTableTypeTrait
}
}
public function setSection(?string $section): void
{
$this->section = $section;
}
public function getSection(): ?string
{
return $this->section;
}
/**
* Whether this field is defined by a plugin or just a value stored in the database.
*/

View File

@@ -14,9 +14,9 @@ use App\Repository\Query\TimesheetQuery;
use Symfony\Component\HttpFoundation\Response;
/**
* TODO change interface for 3.0
* @method getType() string
* @method isInternal() bool
* FIXME change interface for 3.0
* @method string getType()
* @method bool isInternal()
*/
interface ExportRendererInterface
{