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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…