public function execute($configFiles) { $databaseManager = new sfDatabaseManager(); $databaseManager->initialize(); $retval = "<?php\n" . "// auto-generated by " . __CLASS__ . "\n" . "// date: " . date('Y/m/d H:i:s') . "\n"; $email_templates = sfEmailTemplatePeer::doSelect(new Criteria()); if ($email_templates) { foreach ($email_templates as $et) { if ($et->getName()) { $retval .= "DEFINE('" . strtoupper($et->getName() . '_SUBJECT') . "','" . htmlentities($et->getSubject()) . "');\n"; } } } $retval .= "DEFINE('" . strtoupper($et->getName() . '_BODY') . "','" . htmlentities($et->getBody()) . "');\n"; $retval .= "DEFINE('" . strtoupper($et->getName() . '_TEXT_BODY') . "','" . htmlentities($et->getTextBody()) . "');\n"; $retval .= "?>\n"; return $retval; }
public static function retrieveByPKs($pks, $con = null) { if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(); $criteria->add(sfEmailTemplatePeer::ID, $pks, Criteria::IN); $objs = sfEmailTemplatePeer::doSelect($criteria, $con); } return $objs; }