diff --git a/code/SoftDeleteSearchFilter.php b/code/SoftDeleteSearchFilter.php index d6a51ed..2fb34fe 100644 --- a/code/SoftDeleteSearchFilter.php +++ b/code/SoftDeleteSearchFilter.php @@ -30,7 +30,7 @@ protected function applyOne(DataQuery $query) { $this->model = $query->applyRelation($this->relation); $schema = DataObjectSchema::singleton(); - $tableName = $schema->tableName($this->model); + $tableName = $schema->tableForField($this->model, 'Deleted'); $query = $query->setQueryParam("SoftDeletable.filter", false); if ($this->getOnlyDeleted() || $this->name == "OnlyDeleted") { @@ -44,7 +44,7 @@ protected function applyMany(DataQuery $query) { $this->model = $query->applyRelation($this->relation); $schema = DataObjectSchema::singleton(); - $tableName = $schema->tableName($this->model); + $tableName = $schema->tableForField($this->model, 'Deleted'); $query = $query->setQueryParam("SoftDeletable.filter", false); if ($this->getOnlyDeleted() || $this->name == "OnlyDeleted") { @@ -58,7 +58,7 @@ protected function excludeOne(DataQuery $query) { $this->model = $query->applyRelation($this->relation); $schema = DataObjectSchema::singleton(); - $tableName = $schema->tableName($this->model); + $tableName = $schema->tableForField($this->model, 'Deleted'); $query = $query->setQueryParam("SoftDeletable.filter", true); if ($this->getOnlyDeleted() || $this->name == "OnlyDeleted") { @@ -72,7 +72,7 @@ protected function excludeMany(DataQuery $query) { $this->model = $query->applyRelation($this->relation); $schema = DataObjectSchema::singleton(); - $tableName = $schema->tableName($this->model); + $tableName = $schema->tableForField($this->model, 'Deleted'); $query = $query->setQueryParam("SoftDeletable.filter", true); if ($this->getOnlyDeleted() || $this->name == "OnlyDeleted") {