38 lines
968 B
PHP
38 lines
968 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use App\Library\SeatNamePrinter;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class SingleSeatsUser extends Model
|
|
{
|
|
protected $fillable = ['user_id','single_seat_id', 'event_concessions_id', 'paymentmethod_id', 'order_id'];
|
|
protected $table = 'single_seat_user';
|
|
|
|
public function user(){
|
|
return $this->belongsTo('App\User', 'user_id');
|
|
}
|
|
|
|
public function singleSeat(){
|
|
return $this->belongsTo('App\SingleSeat', 'single_seat_id');
|
|
}
|
|
|
|
public function paymentmethod(){
|
|
return $this->belongsTo('App\Paymentmethod', 'paymentmethod_id');
|
|
}
|
|
|
|
public function concession(){
|
|
return $this->belongsTo('App\Concession', 'event_concessions_id');
|
|
}
|
|
|
|
public function order(){
|
|
return $this->belongsTo('App\Order', 'order_id');
|
|
}
|
|
|
|
public function calcSeatName(){
|
|
$seatNamePrinter = new SeatNamePrinter($this);
|
|
return $seatNamePrinter->calcSeatName();
|
|
}
|
|
}
|