File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -71,9 +71,10 @@ public function onFlush(EventArgs $args)
7171 if (isset ($ config ['softDeleteable ' ]) && $ config ['softDeleteable ' ]) {
7272 $ reflProp = $ meta ->getReflectionProperty ($ config ['fieldName ' ]);
7373 $ oldValue = $ reflProp ->getValue ($ object );
74+ $ date = new \DateTime ();
7475
7576 // Remove `$oldValue instanceof \DateTime` check when PHP version is bumped to >=5.5
76- if (isset ($ config ['hardDelete ' ]) && $ config ['hardDelete ' ] && ($ oldValue instanceof \DateTime || $ oldValue instanceof \DateTimeInterface)) {
77+ if (isset ($ config ['hardDelete ' ]) && $ config ['hardDelete ' ] && ($ oldValue instanceof \DateTime || $ oldValue instanceof \DateTimeInterface) && $ oldValue <= $ date ) {
7778 continue ; // want to hard delete
7879 }
7980
@@ -82,7 +83,7 @@ public function onFlush(EventArgs $args)
8283 $ ea ->createLifecycleEventArgsInstance ($ object , $ om )
8384 );
8485
85- $ date = new \ DateTime ();
86+
8687 $ reflProp ->setValue ($ object , $ date );
8788
8889 $ om ->persist ($ object );
You can’t perform that action at this time.
0 commit comments