mirror of
				https://github.com/kevinveenbirkenbach/infinito.git
				synced 2025-11-04 03:07:58 +00:00 
			
		
		
		
	Refactored DBAL Types
This commit is contained in:
		
							
								
								
									
										31
									
								
								application/src/DBAL/Types/LanguageType.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								application/src/DBAL/Types/LanguageType.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,31 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace App\DBAL\Types;
 | 
			
		||||
 | 
			
		||||
use Fresh\DoctrineEnumBundle\DBAL\Types\AbstractEnumType;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Containes all activated languages.
 | 
			
		||||
 *
 | 
			
		||||
 * @author kevinfrantz
 | 
			
		||||
 */
 | 
			
		||||
final class LanguageType extends AbstractEnumType
 | 
			
		||||
{
 | 
			
		||||
    public const GERMAN = 'de';
 | 
			
		||||
 | 
			
		||||
    public const ENGLISH = 'en';
 | 
			
		||||
 | 
			
		||||
    public const DUTCH = 'nl';
 | 
			
		||||
 | 
			
		||||
    public const SPANISH = 'es';
 | 
			
		||||
 | 
			
		||||
    public const ESPERANTO = 'eo';
 | 
			
		||||
 | 
			
		||||
    protected static $choices = [
 | 
			
		||||
        self::GERMAN => 'German',
 | 
			
		||||
        self::ENGLISH => 'English',
 | 
			
		||||
        self::SPANISH => 'Spanish',
 | 
			
		||||
        self::ESPERANTO => 'Esperanto',
 | 
			
		||||
        self::DUTCH => 'Dutch',
 | 
			
		||||
    ];
 | 
			
		||||
}
 | 
			
		||||
@@ -8,6 +8,8 @@ use Fresh\DoctrineEnumBundle\DBAL\Types\AbstractEnumType;
 | 
			
		||||
 * Not integrated in the db. Just used for mapping.
 | 
			
		||||
 * May it will be helpfull for tracking ;).
 | 
			
		||||
 *
 | 
			
		||||
 * @deprecated this class doesn't make sense here. Find an other place for it
 | 
			
		||||
 *
 | 
			
		||||
 * @author kevinfrantz
 | 
			
		||||
 */
 | 
			
		||||
final class MenuEventType extends AbstractEnumType
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										26
									
								
								application/src/DBAL/Types/Meta/Right/CRUDType.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								application/src/DBAL/Types/Meta/Right/CRUDType.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace App\DBAL\Types\Meta\Right;
 | 
			
		||||
 | 
			
		||||
use Fresh\DoctrineEnumBundle\DBAL\Types\AbstractEnumType;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author kevinfrantz
 | 
			
		||||
 */
 | 
			
		||||
final class CRUDType extends AbstractEnumType
 | 
			
		||||
{
 | 
			
		||||
    public const CREATE = 'create';
 | 
			
		||||
 | 
			
		||||
    public const READ = 'read';
 | 
			
		||||
 | 
			
		||||
    public const UPDATE = 'update';
 | 
			
		||||
 | 
			
		||||
    public const DELETE = 'delete';
 | 
			
		||||
 | 
			
		||||
    protected static $choices = [
 | 
			
		||||
        self::CREATE => 'create',
 | 
			
		||||
        self::READ => 'read',
 | 
			
		||||
        self::UPDATE => 'update',
 | 
			
		||||
        self::DELETE => 'delete',
 | 
			
		||||
    ];
 | 
			
		||||
}
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace App\DBAL\Types;
 | 
			
		||||
namespace App\DBAL\Types\Meta;
 | 
			
		||||
 | 
			
		||||
use Fresh\DoctrineEnumBundle\DBAL\Types\AbstractEnumType;
 | 
			
		||||
 | 
			
		||||
@@ -15,6 +15,8 @@ final class LayerType extends AbstractEnumType
 | 
			
		||||
 | 
			
		||||
    public const LAW = 'law';
 | 
			
		||||
 | 
			
		||||
    public const MEMBER = 'member';
 | 
			
		||||
 | 
			
		||||
    protected static $choices = [
 | 
			
		||||
        self::RELATION => 'relation',
 | 
			
		||||
        self::LAW => 'law',
 | 
			
		||||
@@ -9,14 +9,17 @@ use Fresh\DoctrineEnumBundle\DBAL\Types\AbstractEnumType;
 | 
			
		||||
 *
 | 
			
		||||
 * @author kevinfrantz
 | 
			
		||||
 */
 | 
			
		||||
final class TemplateType extends AbstractEnumType
 | 
			
		||||
final class RESTResponseType extends AbstractEnumType
 | 
			
		||||
{
 | 
			
		||||
    public const JSON = 'json';
 | 
			
		||||
 | 
			
		||||
    public const HTML = 'html';
 | 
			
		||||
 | 
			
		||||
    public const XML = 'xml';
 | 
			
		||||
 | 
			
		||||
    protected static $choices = [
 | 
			
		||||
        self::JSON => 'json',
 | 
			
		||||
        self::HTML => 'html',
 | 
			
		||||
        self::XML => 'xml',
 | 
			
		||||
    ];
 | 
			
		||||
}
 | 
			
		||||
@@ -1,20 +0,0 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace App\DBAL\Types;
 | 
			
		||||
 | 
			
		||||
use Fresh\DoctrineEnumBundle\DBAL\Types\AbstractEnumType;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @author kevinfrantz
 | 
			
		||||
 */
 | 
			
		||||
final class RightType extends AbstractEnumType
 | 
			
		||||
{
 | 
			
		||||
    public const READ = 'read';
 | 
			
		||||
 | 
			
		||||
    public const WRITE = 'write';
 | 
			
		||||
 | 
			
		||||
    protected static $choices = [
 | 
			
		||||
        self::READ => 'read',
 | 
			
		||||
        self::WRITE => 'write',
 | 
			
		||||
    ];
 | 
			
		||||
}
 | 
			
		||||
@@ -8,6 +8,10 @@ use Fresh\DoctrineEnumBundle\DBAL\Types\AbstractEnumType;
 | 
			
		||||
 * Containes the system slugs.
 | 
			
		||||
 *
 | 
			
		||||
 * @author kevinfrantz
 | 
			
		||||
 *
 | 
			
		||||
 * @todo Organize this somehow on an other way
 | 
			
		||||
 *
 | 
			
		||||
 * @deprecated
 | 
			
		||||
 */
 | 
			
		||||
final class SystemSlugType extends AbstractEnumType
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user