mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-14 14:16:07 +02:00
Refactored\moved Attribut folder
This commit is contained in:
38
application/symfony/src/Attribut/CrudAttribut.php
Normal file
38
application/symfony/src/Attribut/CrudAttribut.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Attribut;
|
||||
|
||||
use App\Exception\NoValidChoiceException;
|
||||
use App\DBAL\Types\Meta\Right\CRUDType;
|
||||
|
||||
/**
|
||||
* @author kevinfrantz
|
||||
*/
|
||||
trait CrudAttribut
|
||||
{
|
||||
/**
|
||||
* @see CRUDType
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $crud;
|
||||
|
||||
/**
|
||||
* @param string $crud
|
||||
*/
|
||||
public function setCrud(string $crud): void
|
||||
{
|
||||
if (!array_key_exists($crud, CRUDType::getChoices())) {
|
||||
throw new NoValidChoiceException();
|
||||
}
|
||||
$this->crud = $crud;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getCrud(): string
|
||||
{
|
||||
return $this->crud;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user