0

I have a abstract Enum class

abstract class NotificationEnum
{
    const INFO = "info";
    const WARNING = "warning";
    const SUCCESS = "success";
    const ERROR = "error";
 [...]
 }

Now if i change the enum above, changes should also appear to the columDefinition for allowing these as inputs.

/**
 * @Column(type="string", type="string", columnDefinition="enum('info', 'warning', 'success', 'error')")
 * @Type("string")
 */
private $severity;

Is there a possibility to tell doctrine that the inputs can be of a given Type or should i do these things just on validation-level e.g just checking if the input is of a given Type?

thanks you advance!

jo-chris
  • 362
  • 6
  • 13
  • Does this answer your question? [How do I set enum data type in doctrine 2](https://stackoverflow.com/questions/12453448/how-do-i-set-enum-data-type-in-doctrine-2) – Nico Haase Dec 22 '20 at 08:21
  • Or this? https://stackoverflow.com/questions/18062382/right-way-to-define-and-work-with-enum-types-from-symfony2-and-doctrine2 – Nico Haase Dec 22 '20 at 08:21

0 Answers0