public function executeIndex(sfWebRequest $request) { $response = $this->getResponse(); $response->setTitle('Фото постеры. Купить фото постер. Главная'); $response->addMeta('robots', 'Фото постеры. Купить фото постер. Главная'); $response->addMeta('keywords', 'Фото постеры. Купить фото постер. Главная'); $this->menu = MenuPeer::doSelect(new Criteria()); $c = new Criteria(); $c->add(PartsPeer::IS_ACTIVE, 1); $this->parts = PartsPeer::doSelect($c); unset($c); $c1 = new Criteria(); $c1->add(ConfigPeer::PARAM, maintext); $text = ConfigPeer::doSelect($c1); $this->text = $text[0]->getValue(); unset($c1); }
/** * Retrieve multiple objects by pkey. * * @param array $pks List of primary keys * @param PropelPDO $con the connection to use * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function retrieveByPKs($pks, PropelPDO $con = null) { if ($con === null) { $con = Propel::getConnection(ConfigPeer::DATABASE_NAME, Propel::CONNECTION_READ); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(ConfigPeer::DATABASE_NAME); $criteria->add(ConfigPeer::KEY, $pks, Criteria::IN); $objs = ConfigPeer::doSelect($criteria, $con); } return $objs; }
/** * Gets an array of Config objects which contain a foreign key that references this object. * * If this collection has already been initialized with an identical Criteria, it returns the collection. * Otherwise if this Model has previously been saved, it will retrieve * related Configs from storage. If this Model is new, it will return * an empty collection or the current collection, the criteria is ignored on a new object. * * @param PropelPDO $con * @param Criteria $criteria * @return array Config[] * @throws PropelException */ public function getConfigs($criteria = null, PropelPDO $con = null) { if ($criteria === null) { $criteria = new Criteria(ModelPeer::DATABASE_NAME); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collConfigs === null) { if ($this->isNew()) { $this->collConfigs = array(); } else { $criteria->add(ConfigPeer::MODEL_ID, $this->id); ConfigPeer::addSelectColumns($criteria); $this->collConfigs = ConfigPeer::doSelect($criteria, $con); } } else { // criteria has no effect for a new object if (!$this->isNew()) { // the following code is to determine if a new query is // called for. If the criteria is the same as the last // one, just return the collection. $criteria->add(ConfigPeer::MODEL_ID, $this->id); ConfigPeer::addSelectColumns($criteria); if (!isset($this->lastConfigCriteria) || !$this->lastConfigCriteria->equals($criteria)) { $this->collConfigs = ConfigPeer::doSelect($criteria, $con); } } } $this->lastConfigCriteria = $criteria; return $this->collConfigs; }
public function executeGetConfigs(sfWebRequest $request) { $c = new Criteria(); $c->add(ConfigPeer::MODEL_ID, $request->getGetParameter('model_id')); $this->configs = ConfigPeer::doSelect($c); }