models/UserUsernameTrait.php
public function getUsername()
    {
        if (!$this->hasEnabledUsername()) {
            return null;
        }
        $usernameClass = $this->usernameClass;
        $noInit = $usernameClass::buildNoInitModel();
        /* @var $noInit Username */
        return $this->hasOne($usernameClass, [$noInit->createdByAttribute => $this->guidAttribute]);
    }
public function getUsername()
    {
        if (!$this->hasEnabledUsername()) {
            return null;
        }
        $usernameClass = $this->usernameClass;
        $noInit = $usernameClass::buildNoInitModel();
        /* @var $noInit Username */
        return $this->hasOne($usernameClass, [$noInit->createdByAttribute => $this->guidAttribute]);
    }
public function getUsername ( ) { if ( ! $ this -> hasEnabledUsername ( ) ) { return null ; } $ usernameClass = $ this -> usernameClass ; $ noInit = $ usernameClass :: buildNoInitModel ( ) ; /* @var $noInit Username */ return $ this -> hasOne ( $ usernameClass , [ $ noInit -> createdByAttribute => $ this -> guidAttribute ] ) ; }
Get username.
This method may return null, please consider processing the abnormal conditions.
@return BaseBlameableQuery
Get username . This method may return null please consider processing the abnormal conditions .