I have a idea table, with a date field I want to check if the idea has expired.
If the date of the idea if less than today the state is ok, else the state of idea is expire.
Where I have to write this function, If I have to check all the ideas when I start the app.
Sounds like a cron job to me. Create a simple script that set the state of your ideas based on the date, and run that each night.