post 1.3 fixes (#1106)

This commit is contained in:
Kevin Papst
2019-09-17 22:20:36 +02:00
committed by GitHub
parent 13f5e76015
commit 24cbe3d281
12 changed files with 200 additions and 61 deletions

View File

@@ -9,6 +9,7 @@
namespace App\Entity;
use App\Form\Type\YesNoType;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
@@ -49,6 +50,11 @@ trait MetaTableTypeTrait
*/
private $visible = false;
/**
* @var string
*/
private $label;
/**
* @var string
*/
@@ -66,7 +72,11 @@ trait MetaTableTypeTrait
public function getName(): ?string
{
return $this->name;
if (null === $this->name) {
return null;
}
return strtolower($this->name);
}
public function setName(string $name): MetaTableTypeInterface
@@ -82,6 +92,7 @@ trait MetaTableTypeTrait
public function getValue()
{
switch ($this->type) {
case YesNoType::class:
case CheckboxType::class:
return (bool) $this->value;
case IntegerType::class:
@@ -176,4 +187,20 @@ trait MetaTableTypeTrait
return $this;
}
public function getLabel(): ?string
{
if (null === $this->label) {
return $this->name;
}
return $this->label;
}
public function setLabel(string $label): MetaTableTypeInterface
{
$this->label = $label;
return $this;
}
}