Exemple #1
0
 /**
  * Get the associated State object
  *
  * @param      PropelPDO Optional Connection object.
  * @return     State The associated State object.
  * @throws     PropelException
  */
 public function getState(PropelPDO $con = null)
 {
     if ($this->aState === null && $this->state_id !== null) {
         $c = new Criteria(StatePeer::DATABASE_NAME);
         $c->add(StatePeer::ID, $this->state_id);
         $this->aState = StatePeer::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->aState->addPropertys($this);
         		 */
     }
     return $this->aState;
 }
Exemple #2
0
 /**
  * Return the string representation for the birth state
  *
  * @return string
  */
 public function getBirthStaterepresentation()
 {
     $criteria = new Criteria();
     $criteria->add(StatePeer::ID, $this->getBirthState());
     $birth_state = StatePeer::doSelectOne($criteria);
     if ($birth_state) {
         return $birth_state->getName();
     }
 }