コード例 #1
0
 /**
  * Get the associated Visit object
  *
  * @param      PropelPDO Optional Connection object.
  * @return     Visit The associated Visit object.
  * @throws     PropelException
  */
 public function getVisit(PropelPDO $con = null)
 {
     if ($this->aVisit === null && $this->visit_id !== null) {
         $c = new Criteria(VisitPeer::DATABASE_NAME);
         $c->add(VisitPeer::ID, $this->visit_id);
         $this->aVisit = VisitPeer::doSelectOne($c, $con);
         /* The following can be used additionally to
         		   guarantee the related object contains a reference
         		   to this object.  This level of coupling may, however, be
         		   undesirable since it could result in an only partially populated collection
         		   in the referenced object.
         		   $this->aVisit->addVisitMedicines($this);
         		 */
     }
     return $this->aVisit;
 }