We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
The text was updated successfully, but these errors were encountered:
Can you try this in ActiveQuery class?
public function behaviors() { return [ \cornernote\softdelete\SoftDeleteQueryBehavior::className(), // or [ 'class' => \cornernote\softdelete\SoftDeleteQueryBehavior::className(), 'attribute' => 'deleted_time', ], ]; }
Sorry, something went wrong.
I just realized Ive posted this on the wrong library (Im actually using yii2tech\ar\softdelete)
Sorry about that
No branches or pull requests
Hey, Ive set softdelete behavior in an ActiveRecord model with the following config:
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:
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.
The text was updated successfully, but these errors were encountered: