コード例 #1
0
 public function getPrimaryContactInfo()
 {
     $contact = ContactInfoPeer::getUserContactInfo($this->getUserId(), 'primary');
     if ($contact == null) {
         $contact = new ContactInfo();
         $contact->setTitle('Primary');
         $contact->setEmail($this->getsfGuardUser()->getUserName());
         $contact->setPrivacyLevel(sfConfig::get('app_profile_privacy_default'));
         $contact->setUserId($this->getUserId());
         $contact->save();
     }
     return $contact;
 }