userMetaModel() public static méthode

Get a reference to the user meta model.
public static userMetaModel ( ) : UserMetaModel
Résultat UserMetaModel
 public function profileController_usernameMeta_handler($sender, $args)
 {
     // get all fields since that is better for caching!
     $profileFields = Gdn::userMetaModel()->getUserMeta($sender->User->UserID, 'Profile.%', 'Profile.');
     $nickname = $profileFields['Profile.' . c('Nickname.Fieldname')];
     if ($nickname) {
         echo '<span class="Nickname">(a.k.a. ' . $nickname . ')</span>';
     }
 }
Exemple #2
0
 public static function get($Key, $Default = null)
 {
     $Response = Gdn::userMetaModel()->getUserMeta(0, $Key, $Default);
     if (sizeof($Response) == 1) {
         return val($Key, $Response, $Default);
     }
     return $Default;
 }
Exemple #3
0
 /**
  * Instance of UserMetaModel.
  *
  * @return UserMetaModel
  */
 public function userMetaModel()
 {
     return Gdn::userMetaModel();
 }