mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Refactored\moved Attribut folder
This commit is contained in:
40
application/symfony/src/Attribut/LayerAttribut.php
Normal file
40
application/symfony/src/Attribut/LayerAttribut.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\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