Skip to content

Commit 93bd539

Browse files
authored
Update patch method call to include guard option (#80)
Trash no longer works without setting $_accessible true on trash field Fixes #79
1 parent 9ef3df0 commit 93bd539

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

src/Model/Behavior/TrashBehavior.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,7 @@ public function trash(EntityInterface $entity, array $options = []): bool
160160
}
161161
}
162162

163-
/** @phpstan-ignore function.alreadyNarrowedType */
164-
if (method_exists($entity, 'patch')) {
165-
$entity->patch([$this->getTrashField(false) => new DateTime()]);
166-
} else {
167-
$entity->set($this->getTrashField(false), new DateTime());
168-
}
163+
$entity->set($this->getTrashField(false), new DateTime());
169164

170165
return (bool)$this->_table->save($entity, $options);
171166
}

0 commit comments

Comments
 (0)