Skip to content

jarddel/enum-type

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Robusto EnumType!

A robust and simple way to define enumerative in php using Doctrine 2 Types.

Scrutinizer Code Quality Latest Development PHP License
Requirements:

============= #### Can be used along with [DBAL](https://github.com/doctrine/dbal) (Database Abstraction Layer). To work on the concept of types: ============= A Simple Example: ```php class DayWeekEnum extends EnumType { const SUNDAY = 1, MONDAY = 2, TUESDAY = 3, WEDNESDAY = 4, THURSDAY = 5, FRIDAY = 6, SATURDAY = 7 ; } ```

Adding types to configurations:

doctrine:
   dbal:
       types:
           day_week: DayweekEnum

Using types with annotation:

/** @Entity */
class Foo
{
    /** @Column(type="integer") */
    private $id;

    /** @Column(type="day_week", name="day_week") */
    private $day;
}

Using types with XML:

<entity name="Foo" table="foo">
    <id name="id" column="id" type="integer" />
    <field name="day" column="day_week" type="day_week" />
</entity>

About

A robust and simple way to define enumerative types in php.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages