Comments (2)
@kakapiciu will try to implement a proof of concept
solution 2, variant #2
from admin.
Solution 1: Mapping to Varchars is what we're currently using and as we know, it has it's own flaws (showing unnecessary modifications in each migration).
Solution 2: Defining a Type seems to be the preferred approach in most frameworks.
In addition to the method described in the article, there should be either:
-
An abstract type that then could be extended by each custom enumType
abstract class AbstractEnumType extends Type
containing all the methods defined in the article (getSQLDeclaration
,convertToPHPValue
etc)
Then custom enumTypes extending AbstractEnumType that have only one purpose, providing the values (which can be defined as constants in the custom enumType and also used in the $values array - this way the values are defined only once and constants can also be reused outside the class) -
One single enumType that when added to a property, can be configured (if needed, the
values
parameter's name can be changed to a more suitable one):#[ORM\Column(name: "status", type: EnumType::class, values: ["pending", "active"])]
If this can be implemented, it would be the easisest solution both to write and to use.
Note:
Both solutions (the abstract / generic enumTypes) are theoretical, I did not try them in practice. Their purpose is only to give an idea on where to start implementing these types.
from admin.
Related Issues (20)
- sample filter in admin logins page
- missing scoll bar at top of the table
- identity listed when you remove all columns HOT 1
- logomark when the left menu is collapsed HOT 1
- refactor all Catch to log instead of show errors HOT 1
- PHPCS extension
- Remove unused SVG icons from public folder HOT 1
- doctrine/cache sunset // find replacement HOT 12
- investigate laminas-http package HOT 1
- remove use Doctrine\Common\Cache\PhpFileCache; HOT 1
- Update dot-cli & dot-geoip versions HOT 1
- refactor COnfigProvider HOT 1
- Update package.json HOT 1
- Documentation
- handle error if geoip does not return a valid IP HOT 4
- remove user-agent-sniffer integration and make it optional
- update static analysis actions HOT 1
- Remove unnecessary `HasLifecycleCallbacks` entity attributes
- replace annotated with attributes HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from admin.