Comments (11)
Same here, but in different context
User Deprecated: Method Doctrine\ORM\Event\OnFlushEventArgs::getEntityManager() is deprecated and will be removed in Doctrine ORM 3.0. Use getObjectManager() instead. (OnFlushEventArgs.php:34 called by ORM.php:98, https://github.com/doctrine/orm/issues/9875, package doctrine/orm)
from doctrineextensions.
Any possible updates on this?
from doctrineextensions.
This is not deprecated in Doctrine itself. However, Symfony has deprecated registering Doctrine subscribers because they cannot be lazy-loaded (contrary to Symfony subscribers, the Doctrine ones require instantiating the object to get the list of subscribed events).
In https://packagist.org/packages/stof/doctrine-extensions-bundle, I already updated the way listeners are registered to be compatible with this lazy-loading (include tests that will ensure that the explicit registration is in sync with the library subscriber).
If you manage the listener yourselves instead of using the bundle, you need to manage the registration yourselves.
from doctrineextensions.
@mcanepa ,
You could just remove the call to annotation reader that you've set in your config file, or better option, use the @stof 's bundle properly and in hisstof_doctrine_extensions_yaml
set something like this :
# Read the documentation: https://symfony.com/doc/current/bundles/StofDoctrineExtensionsBundle/index.html
# See the official DoctrineExtensions documentation for more details: https://github.com/doctrine-extensions/DoctrineExtensions/tree/main/doc
stof_doctrine_extensions:
default_locale: fr_FR
orm:
default:
timestampable: true
sluggable: true
It should works just fine
from doctrineextensions.
Waiting for any update too
from doctrineextensions.
Just found my answer in the documentation : https://github.com/doctrine-extensions/DoctrineExtensions/blob/main/doc/symfony.md#doctrine-extension-listener-services
Needed to update the config in services.yaml
from doctrineextensions.
@LaurentSanson I get
The service "gedmo.listener.tree" has a dependency on a non-existent service "annotation_reader"
how did you solve it?
from doctrineextensions.
@LaurentSanson I did both:
In config/services.yaml I removed
calls:
- [ setAnnotationReader, [ "@annotation_reader" ] ]
and instead of using
gedmo.listener.timestampable:
class: Gedmo\Timestampable\TimestampableListener
tags:
- { name: doctrine.event_listener, event: 'prePersist' }
- { name: doctrine.event_listener, event: 'onFlush' }
- { name: doctrine.event_listener, event: 'loadClassMetadata' }
I used config/stof_doctrine_extensions.yaml
stof_doctrine_extensions:
default_locale: en_US
orm:
default:
timestampable: true
now TimestampableEntity trait works but only for POST operation, it fails on PUT. I get
An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'created_at' cannot be null"
from doctrineextensions.
I think you can get rid of the calling of timestampable in your services.yaml
as it is enabled in stof_doctrine_extensions.yaml
from doctrineextensions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from doctrineextensions.
from doctrineextensions.
Related Issues (20)
- ORM 3 deprecations HOT 6
- Nested tree and Sortable together
- psr-4 autoloading issue in 3.16.0 HOT 1
- Inconsistent mapping types in extensions
- Double-check date/time mapping support for immutable types
- Tree object class must have tree metadata at this point HOT 1
- Sluggable handlers (only available in annotations) HOT 6
- Blameable and Frankenphp creates a new entity HOT 2
- Allow custom string instead of FQCN for object_class discriminator field
- Mysql 8 Soft Deleted entities are returned HOT 2
- Uncaught Error: Attempting to use non-attribute class "Gedmo\Translatable\Translatable" as attribute HOT 2
- [Translateable] missing translation table entry when string is same as in default locale HOT 2
- [Repo] Codecov not uploading on push to `main` HOT 2
- [Tree] Materialized path value not correct for generated ids pre-set with a non-null value
- [Translatable] Detached required method. Interface design. HOT 2
- [Timestampable] Allow multiple fields for "change" trigger in XML mapping
- [Translateable] + Doctrine Table Inheritance: wrong object class in table "ext_translations"
- [Loggable] Invert logic to log everything but ignore some entities by config
- doctrine extensions translatable not working in symfony 6.4 with orm 3.1 HOT 6
- [Timestampable] Allow setting clock manually for bulk imports/fixtures HOT 4
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 doctrineextensions.