mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-04-16 10:16:22 +02:00
43 lines
779 B
PHP
43 lines
779 B
PHP
<?php
|
|
|
|
namespace Infinito\Attribut;
|
|
|
|
use Infinito\DBAL\Types\Meta\Right\LayerType;
|
|
use Infinito\Exception\Type\InvalidChoiceTypeException;
|
|
|
|
/**
|
|
* @author kevinfrantz
|
|
*
|
|
* @see LayerAttributInterface
|
|
*/
|
|
trait LayerAttribut
|
|
{
|
|
/**
|
|
* @see LayerType
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $layer;
|
|
|
|
/**
|
|
* @param string $layer
|
|
*
|
|
* @throws InvalidChoiceTypeException
|
|
*/
|
|
public function setLayer(string $layer): void
|
|
{
|
|
if (!in_array($layer, LayerType::getValues())) {
|
|
throw new InvalidChoiceTypeException("'$layer' is not a correct layer type.");
|
|
}
|
|
$this->layer = $layer;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getLayer(): string
|
|
{
|
|
return $this->layer;
|
|
}
|
|
}
|