symfony - Gedmo multiple database connections not listening correctly -
when trying create entity @gedmo\timestampable(on="create") annotation, getting "sqlstate[23000]: integrity constraint violation: 1048 column 'created' cannot null"
it doesn't work gedmo\slug.
it works when using default entity manager, not when using master or creation.
in config.yml have following configuration:
stof_doctrine_extensions: default_locale: en translation_fallback: true orm: default: timestampable: true sluggable: true master: timestampable: true sluggable: true creation: timestampable: true sluggable: true
in services.yml have following:
gedmo.listener.timestampable: class: gedmo\timestampable\timestampablelistener tags: - { name: doctrine.event_subscriber, connection: default } - { name: doctrine.event_subscriber, connection: creation } - { name: doctrine.event_subscriber, connection: master } calls: - [ setannotationreader, [ @annotation_reader ] ] gedmo.listener.sluggable: class: gedmo\sluggable\sluggablelistener tags: - { name: doctrine.event_subscriber, connection: default } - { name: doctrine.event_subscriber, connection: master } - { name: doctrine.event_subscriber, connection: creation } calls: - [ setannotationreader, [ @annotation_reader ] ]
it seems event_subscriber not working correctly.
i running symfony 2.3.2 stofdoctrineextensionsbundle.
the entity creating slug has this:
/** * @var string * * @orm\column(name="title", type="string", length=255) */ private $title; /** * @var string * @gedmo\slug(fields={"title"}) * @orm\column(name="slug", type="string", length=255, unique=true) */ private $slug;
the entity created has this:
/** * @var \datetime * @gedmo\timestampable(on="create") * @orm\column(name="created", type="datetime") */ private $created;
any ideas?
Comments
Post a Comment