Reputation: 13
i am new in cakephp I have a table named souscriptions this table has a field called expiration_date and another field called "state" that can have only two value : 0 or 1.
i want to change automatically the value of the "state" field when the current system date equals to the the value of the expiration_date field. i am using cakePHP. i have more than one million records in the subscription table.
How can i perform it with cakephp ? Thanks for your precious answers.
Upvotes: 0
Views: 47
Reputation: 25698
Create a CakePHP Shell, read the subscriptions in Chunks of X records to avoid a memory overflow and repeat that until no more subscriptions to process are left. Then run the shell with a Cronjob every day or whatever interval you prefer.
References:
Upvotes: 2