Skip to content

Commit 5ce9167

Browse files
committed
Make deleted value configurable for SoftDeleteableFilter.php
1 parent b0661f1 commit 5ce9167

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/SoftDeleteable/Filter/SoftDeleteableFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAli
7070

7171
$column = $quoteStrategy->getColumnName($config['fieldName'], $targetEntity, $platform);
7272

73-
$addCondSql = $targetTableAlias.'.'.$column.' '.$config['deletedValue'] === null ? 'IS NULL' : '= ' . $config['deletedValue'];
73+
$addCondSql = $targetTableAlias.'.'.$column.' '.(isset($config['deletedValue']) ? '= ' . $config['deletedValue'] : 'IS NULL');
7474
if (isset($config['timeAware']) && $config['timeAware']) {
7575
$addCondSql = "({$addCondSql} OR {$targetTableAlias}.{$column} > {$platform->getCurrentTimestampSQL()})";
7676
}

src/SoftDeleteable/Mapping/Driver/Attribute.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ public function readExtendedMetadata($meta, array &$config)
6262

6363
$config['hardDelete'] = $annot->hardDelete;
6464
}
65+
66+
if (isset($annot->deletedValue)) {
67+
$config['deletedValue'] = $annot->deletedValue;
68+
}
6569
}
6670

6771
$this->validateFullMetadata($meta, $config);

0 commit comments

Comments
 (0)