File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,8 +111,13 @@ public function deleteInactiveWithoutSteps(?int $documentId = null): int {
111111 }
112112
113113 $ qb = $ this ->db ->getQueryBuilder ();
114- $ qb ->delete ($ this ->getTableName ())
115- ->where ($ qb ->expr ()->in ('id ' , $ qb ->createFunction ($ selectSubQuery ->getSQL ())));
114+ $ qb ->delete ($ this ->getTableName ());
115+ if ($ documentId !== null ) {
116+ $ qb ->where ($ selectSubQuery ->expr ()->eq ('document_id ' , $ selectSubQuery ->createParameter ('documentId ' )));
117+ $ qb ->andWhere ($ qb ->expr ()->in ('id ' , $ qb ->createFunction ($ selectSubQuery ->getSQL ())));
118+ } else {
119+ $ qb ->where ($ qb ->expr ()->in ('id ' , $ qb ->createFunction ($ selectSubQuery ->getSQL ())));
120+ }
116121 $ qb ->setParameters ([
117122 'lastContact ' => time () - SessionService::SESSION_VALID_TIME ,
118123 'documentId ' => $ documentId ,
You can’t perform that action at this time.
0 commit comments