public function executeSearchPatient(sfWebRequest $request) { //$patient_id = $this->getRequestParameter('id'); $patient_name = $this->getRequestParameter('name'); $c = new Criteria(); //$c->add(PatientPeer::STATUS, Constant::RECORD_STATUS_ACTIVE); /*$c1 = $c->getNewCriterion(PatientPeer::NAME, '%'.$patient_name.'%' , Criteria::LIKE); $c2 = $c->getNewCriterion(PatientPeer::ID, $patient_id, Criteria::EQUAL); $c1->addOr($c2); $c->add($c1);*/ $c->add(PatientPeer::NAME, '%' . $patient_name . '%', Criteria::LIKE); $this->patients = PatientPeer::doSelect($c); }
/** * 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(PatientPeer::DATABASE_NAME, Propel::CONNECTION_READ); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(PatientPeer::DATABASE_NAME); $criteria->add(PatientPeer::ID, $pks, Criteria::IN); $objs = PatientPeer::doSelect($criteria, $con); } return $objs; }