mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 21:57:16 +02:00
Optimized layer attribut
This commit is contained in:
@@ -2,21 +2,37 @@
|
||||
|
||||
namespace App\Entity\Attribut;
|
||||
|
||||
use App\DBAL\Types\Meta\Right\LayerType;
|
||||
use App\Exception\NoValidChoiceException;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait LayerAttribut
|
||||
{
|
||||
/**
|
||||
* @see LayerType
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $layer;
|
||||
|
||||
/**
|
||||
* @param string $layer
|
||||
*
|
||||
* @throws NoValidChoiceException
|
||||
*/
|
||||
public function setLayer(string $layer): void
|
||||
{
|
||||
if (!array_key_exists($layer, LayerType::getChoices())) {
|
||||
throw new NoValidChoiceException();
|
||||
}
|
||||
$this->layer = $layer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getLayer(): string
|
||||
{
|
||||
return $this->layer;
|
||||
|
Reference in New Issue
Block a user