/** * this checks if recalculation of totals and status is needed * of the opened invoices * * @return void **/ private function checkIfUpdateTotals() { // if the property is not set, we set it here if (!PropertyTable::get('last_calculation_date')) { PropertyTable::set('last_calculation_date', '1970-01-01'); } $last = new sfDate(PropertyTable::get('last_calculation_date')); $today = new sfDate(); if ($today->diff($last, sfTime::DAY) > 0) { CommonTable::calculateTotals(); PropertyTable::set('last_calculation_date', $today->format('Y-m-d')); } }