Open
Description
Hey, Ive set softdelete behavior in an ActiveRecord model with the following config:
TimestampBehavior::className(),
'softDeleteBehavior' => [
'class' => SoftDeleteBehavior::className(),
'softDeleteAttributeValues' => [
'deleted_at' => new Expression('UNIX_TIMESTAMP()')
],
'replaceRegularDelete' => true
],
Its working: when I delete, "detelet_at" is set with the unix timestamp.
Now, to retrieve without the deleted ones, Ive set the query like this:
class UserQuery extends ActiveQuery
{
public function behaviors()
{
return [
'softDelete' => [
'class' => SoftDeleteQueryBehavior::className(),
'deletedCondition' => [
'deleted_at' => new Expression('IS NOT NULL'),
],
'notDeletedCondition' => [
'deleted_at' => new Expression('IS NULL'),
],
],
];
}
}
Its being completely ignored, the deleted records are returned normally on any query
Im not sure its a bug, sorry if it inst. But everything seems right and I dont know what could be wrong.
Metadata
Metadata
Assignees
Labels
No labels