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(NgTaMedicalRecordDetailPeer::ID, $pks, Criteria::IN);
         $objs = NgTaMedicalRecordDetailPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
예제 #2
0
 public function getNgTaMedicalRecordDetailsJoinNgMedicalReference($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseNgTaMedicalRecordDetailPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collNgTaMedicalRecordDetails === null) {
         if ($this->isNew()) {
             $this->collNgTaMedicalRecordDetails = array();
         } else {
             $criteria->add(NgTaMedicalRecordDetailPeer::NG_TA_MEDICAL_RECORD_ID, $this->getId());
             $this->collNgTaMedicalRecordDetails = NgTaMedicalRecordDetailPeer::doSelectJoinNgMedicalReference($criteria, $con);
         }
     } else {
         $criteria->add(NgTaMedicalRecordDetailPeer::NG_TA_MEDICAL_RECORD_ID, $this->getId());
         if (!isset($this->lastNgTaMedicalRecordDetailCriteria) || !$this->lastNgTaMedicalRecordDetailCriteria->equals($criteria)) {
             $this->collNgTaMedicalRecordDetails = NgTaMedicalRecordDetailPeer::doSelectJoinNgMedicalReference($criteria, $con);
         }
     }
     $this->lastNgTaMedicalRecordDetailCriteria = $criteria;
     return $this->collNgTaMedicalRecordDetails;
 }
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = NgTaMedicalRecordDetailPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setNgTaMedicalRecordId($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setRecordType($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setNgMedicalReferenceId($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setProblem($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setDetail($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setCreated($arr[$keys[6]]);
     }
 }