public function postUp() { parent::postUp(); // Set dates for all existing news $news = News_Model_NewsTable::getInstance()->findAll(); foreach ($news as $article) { if ($article->public == 'yes') { $article->publish_date = $article->created_at; $article->save(); } } }
public function postUp() { parent::postUp(); $q = Doctrine_Manager::getInstance()->getCurrentConnection(); $q->exec('UPDATE petition p SET p.activity_at = (SELECT created_at FROM petition_signing ps WHERE ps.petition_id = p.id ORDER BY ps.id DESC LIMIT 1)'); }
public function postUp() { parent::postUp(); $q = Doctrine_Manager::getInstance()->getCurrentConnection(); $q->exec('UPDATE LOW_PRIORITY petition_signing_wave psw SET psw.contact_num = (SELECT count(*) FROM petition_signing_contact psc where psc.petition_signing_id = psw.petition_signing_id and psc.wave = psw.wave)'); }