/** * List */ public function executeList() { $this->output = array(); foreach (TemplatePeer::doSelect(new Criteria()) as $template) { $data = $template->toArray(BasePeer::TYPE_FIELDNAME); $records = array(); foreach ($template->getTemplateRecords() as $record) { $records[] = $record->toArray(BasePeer::TYPE_FIELDNAME); } $data['records'] = $records; $this->output[] = $data; } if ($this->isAjax()) { return $this->renderStore('Template', $this->output); } }
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(TemplatePeer::ID, $pks, Criteria::IN); $objs = TemplatePeer::doSelect($criteria, $con); } return $objs; }