Category : enums

I want to set a default value for an attribute called "status" in my entity called "Book" : <?php namespace AppEntity; /** * @ORMEntity(repositoryClass=BookingRepository::class) */ class Booking { const STATUS = [ 0 => ‘Pending’, 1 => ‘Canceled’, 2 => ‘Confirmed’, 3 => ‘Approved’, ]; /** * @ORMId() * @ORMGeneratedValue() * @ORMColumn(type="integer") */ private $id; ..

Read more