PHP code example of adrenalinkin / enum-property-bundle

1. Go to this page and download the library: Download adrenalinkin/enum-property-bundle 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/ */

    

adrenalinkin / enum-property-bundle example snippets



// app/AppKernel.php

class AppKernel extends Kernel
{
    // ...

    public function registerBundles()
    {
        $bundles = [
            // ...

            new Linkin\Bundle\EnumPropertyBundle\LinkinEnumPropertyBundle(),
        ];

        return $bundles;
    }

    // ...
}



use Linkin\Component\EnumMapper\Mapper\AbstractEnumMapper;

class GenderMapper extends AbstractEnumMapper
{
    const DB_UNDEFINED = 0;
    const DB_MALE      = 10;
    const DB_FEMALE    = 20;

    const HUMAN_UNDEFINED = 'Undefined';
    const HUMAN_MALE      = 'Male';
    const HUMAN_FEMALE    = 'Female';
}