Some time ago I started another project based on the Symfony framework. Until now, creating models based on the classes generated from the description in the file schema.yml it was the most enjoyable part of the job. It turned out, however, that not everything is as rosy as he may at first glance seem. The processing mechanism has a problem with certain names, a problem which manifests itself in the form of fairly uninteresting, the title of the error. Feel free to read.
Here is the code
If using the Console utility symfony execute the command:
./symfony doctrine:build –all-classes
then the generator when the hits on this model, quickly throws on screen message:
When using the attribute ATTR_AUTO_ACCESSOR_OVERRIDE you cannot use the field name „data”.
I was unable to determine what exactly is said attribute, but based on reading a few sites on the internet I suspect it has to do with the dynamic mapping method calls setX () / getX the relevant field model, where X is the name of a specific course field e.g. SETID () getId ().
The problem lies in the fact that some of these accessor functions interfere with the existing classes, which our freedom in the naming of the fields is not as unlimited as we want. ;]
Bit of a shame the developer to use such “hacks”, but sometimes, unfortunately, there is no other option, and the project itself will not do, also kindly ask for forgiveness. It is important that the final code, everything is done as it should be. ;]