Use PHP Enums as Doctrine type in Symfony

PHP 8.1 adds support for Enumerations. An Enumeration, is an enumerated type that has a fixed number of possible values. (see more details)

✍🏻 In this article, I’ll show you how to use an Enum as a doctrine WITHOUT adding configuration.

First, what is a doctrine type?

--

--

--

Fullstack Developer- certified Symfony 4,5 and certified AWS Solution Architect - Freelancer - Remote Worker

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

# MBL: Meta Bunny Legends (http://metabunnylegends.io) will release 3333 NFTs on April 15th.

Reviewing the Code Review, Part I

GitOps applied to Kubernetes environments

Introduction to Image Processing in Python. Am I doing this right?

How to survive coding bootcamp..

Exciting things in Android O

A simple calculator with rust using WASM

Java 8 — Binary Operator | Code Factory

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Smaine Milianni

Smaine Milianni

Fullstack Developer- certified Symfony 4,5 and certified AWS Solution Architect - Freelancer - Remote Worker

More from Medium

Emoji flag in the Symfony CountryType

Symfony Station Communique —14 January 2022. A look at Symfony and PHP news.

Photo of Reuben Walker

Achieve parallel processing in php using shell_exec()

Refactoring #2: From controllers to actions