PHP code example of vr / doctrine-dbal-enum-type

1. Go to this page and download the library: Download vr/doctrine-dbal-enum-type library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

vr / doctrine-dbal-enum-type example snippets




namespace AppBundle\Doctrine\DBAL\Types;
use Vr\Doctrine\DBAL\Types\AbstractEnumType;

class StatusType extends AbstractEnumType
{
    const ENABLED   = 'enabled';

    const DISABLED  = 'disabled';

    const DELETED  = 'deleted';

    const UNVERIFED = 'unverifed';

    protected static $default = self::UNVERIFED;

    protected static $values = [
        self::ENABLED,
        self::DISABLED,
        self::DELETED,
        self::UNVERIFED
    ];

    public static function getEnabled()
    {
        return static::ENABLED;
    }

    public static function getDisabled()
    {
        return static::DISABLED;
    }

    public static function getDeleted()
    {
        return static::DELETED;
    }

    public static function getUnverifed()
    {
        return static::UNVERIFED;
    }
}