Skip to content

Commit

Permalink
fix table name
Browse files Browse the repository at this point in the history
  • Loading branch information
lekoala committed Nov 10, 2021
1 parent 95b1c00 commit 288692b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions code/SoftDeleteSearchFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand All @@ -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") {
Expand All @@ -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") {
Expand All @@ -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") {
Expand Down

0 comments on commit 288692b

Please sign in to comment.