app\models\TournamentRegistration::user PHP Method

user() public method

public user ( )
    public function user()
    {
        return $this->belongsTo('App\\Models\\User');
    }

Usage Example

コード例 #1
0
ファイル: Tournament.php プロジェクト: echojc/osu-web
 public function register($user)
 {
     if ($this->isSignedUp($user)) {
         return;
     }
     //sanity check: we shouldn't be touching users once the tournament is already in action.
     if ($this->isTournamentRunning()) {
         return;
     }
     $reg = new TournamentRegistration();
     $reg->user()->associate($user);
     $this->registrations()->save($reg);
 }
TournamentRegistration