Added method to get the PersonTarget of a Booking.
This commit is contained in:
@@ -54,6 +54,21 @@ class Booking extends Model
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the person target of the booking. If the booking consists of more than
|
||||
* one sub-booking, null is returned.
|
||||
*
|
||||
* @return App\AccountType
|
||||
*/
|
||||
public function personTarget()
|
||||
{
|
||||
if ($this->isSimple()) {
|
||||
return $this->subBookings->first()->personTarget;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* INDIRECT PROPERTIES *
|
||||
**************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user