Closed archie18 closed 10 years ago
Hi :) sorry for the late reply, so in the current version of the bundle there is no way to define any date until the model object is valid. So I think the easiest way to do it is to use a Symfony command as you did.
Hi and thank you for replying.
I came up with the idea to define a state Post::STATUS_EXPIRED
and to register a validator that performs a date comparison and creates a violation if the expiration date is not yet reached. In theory this should work. But I noticed that for each validation violation an entry is created in the lexik_workflow_model_state
table. These entries could easily produce a lot of unnecessary data.
Is there any way to prevent logging of failed violations?
No, we log all violations, but it could be an idea to improve the bundle.
Will close this for now.
Is it possible to define an expiration date for a certain object state? To keep with the example of the documentation, let's assume I wish to delete all
Post
objects whose model state have beenPost::STATUS_DRAFT
for more than 30 days.I could easily do this manually by calling a Symfony2 console command from a daily cronjob. But how would I properly do this within the workflow framework?