You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to configure the softdeletable feature for my odm document.
My configuration looks like this:
config.yml
doctrine_mongodb:
connections:
default:
...
document_managers:
default:
filters:
softdeleteable:
class: Gedmo\SoftDeleteable\Filter\ODM\SoftDeleteableFilter
enabled: true
stof_doctrine_extensions:
orm:
default:
timestampable: true
sluggable: true
mongodb:
default:
timestampable: true
#Without this I get a "Listener “SoftDeleteableListener” was not added to the EventManager" error (Not in ORM)
softdeleteable: true
/**
* @MongoDB\Document(db="test", collection="pictures")
* @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false)
*/
class Picture
{
...
/**
* @MongoDB\Date
*/
protected $deletedAt;
...
/**
* Set deletedAt
*
* @param date $deletedAt
* @return self
*/
public function setDeletedAt($deletedAt)
{
$this->deletedAt = $deletedAt;
return $this;
}
/**
* Get deletedAt
*
* @return date $deletedAt
*/
public function getDeletedAt()
{
return $this->deletedAt;
}
}
If I remove the config for softdeletable fetching and removing is working properly.
But with the softdeleteable feature on I can't fetch any pictures and if I try to remove one I get following error:
No mapping found for field 'deletedAt' in class 'Tes\StoreBundle\Document\Picture'.
Am I doing somethin wrong?
Thanks,
David
The text was updated successfully, but these errors were encountered:
why are you trying to register the listener yourself ? It is what the bundle is doing.
Anyway, doctrine.odm.mongodb.default_event_subscriber is the wrong tag name for the ODM, so your own service is not registered as a listener for the ODM
is it the correct behavior that deletedAt is set but all select statements returns the deleted document?
Because the DoctrineExtensions list the softdeleatable feature only works for orm.
Hi,
I'm trying to configure the softdeletable feature for my odm document.
My configuration looks like this:
config.yml
service.yml
Document
If I remove the config for softdeletable fetching and removing is working properly.
But with the softdeleteable feature on I can't fetch any pictures and if I try to remove one I get following error:
No mapping found for field 'deletedAt' in class 'Tes\StoreBundle\Document\Picture'.
Am I doing somethin wrong?
Thanks,
David
The text was updated successfully, but these errors were encountered: