What do you use instead of ENUM in Doctrine2? smallint? I thought of using varchar, or explicitly define char, but this may not be very effective when it comes to indexes, or am
I usually work with integers mapped to class constants, like
class MyEntity {
const STATUS_INACTIVE = 0;
const STATUS_ACTIVE = 1;
const STATUS_REFUSE = 2;
protected $status = self::STATUS_ACTIVE;
}
That works quite fine and makes it even easier to work with what you would call ENUMS in an IDE.
You can also use an enumerable type as described by the documentation, but that means you will have to define one custom type per enum column. That's a lot of work with no real benefit.
You may also want to know why you shouldn't really use enums.