label map * @method static array type_id__enum_ids() Get array of all valid enum IDs * * @mixin \Eloquent */ class Flash_Alert_Model extends Rsx_Model_Abstract { /** * _AUTO_GENERATED_ Enum constants */ const TYPE_SUCCESS = 1; const TYPE_ERROR = 2; const TYPE_INFO = 3; const TYPE_WARNING = 4; /** __AUTO_GENERATED: */ /** __/AUTO_GENERATED */ // Enum constants (auto-generated by rsx:migrate:document_models) public static $enums = [ 'type_id' => [ 1 => ['constant' => 'TYPE_SUCCESS', 'label' => 'Success'], 2 => ['constant' => 'TYPE_ERROR', 'label' => 'Error'], 3 => ['constant' => 'TYPE_INFO', 'label' => 'Info'], 4 => ['constant' => 'TYPE_WARNING', 'label' => 'Warning'], ], ]; public static $rel = []; protected $table = '_flash_alerts'; /** * The attributes that should be cast to native types. * * @var array */ protected $casts = [ 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; /** * Get the type as a string for client consumption * * @return string 'success'|'error'|'info'|'warning' */ public function get_type_string(): string { $type_map = [ self::TYPE_SUCCESS => 'success', self::TYPE_ERROR => 'error', self::TYPE_INFO => 'info', self::TYPE_WARNING => 'warning', ]; return $type_map[$this->type_id] ?? 'info'; } }