/** * Get the associated UserType object * * @param PropelPDO Optional Connection object. * @return UserType The associated UserType object. * @throws PropelException */ public function getUserType(PropelPDO $con = null) { if ($this->aUserType === null && $this->user_type_id !== null) { $c = new Criteria(UserTypePeer::DATABASE_NAME); $c->add(UserTypePeer::ID, $this->user_type_id); $this->aUserType = UserTypePeer::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->aUserType->addsfGuardUserProfiles($this); */ } return $this->aUserType; }
public static function getUserTypeDb($code) { $c = new Criteria(); $c->add(UserTypePeer::CODE, $code); return UserTypePeer::doSelectOne($c); }