Invoice report
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by Pensare Software.
|
||||
* User: Theo Weijmer
|
||||
* Date: 07/03/2018
|
||||
* Time: 09:24
|
||||
*/
|
||||
|
||||
class Reservation extends BaseModel {
|
||||
|
||||
public function project()
|
||||
{
|
||||
return $this->belongsTo( 'Project' );
|
||||
}
|
||||
|
||||
public static function saveReservation( $reservationID, $reservation )
|
||||
{
|
||||
$reservation = (array) $reservation;
|
||||
|
||||
if ( $reservationID == 0 )
|
||||
{
|
||||
$reservation = self::create( $reservation );
|
||||
$reservationID = $reservation['id'];
|
||||
}
|
||||
else
|
||||
{
|
||||
self::whereId( $reservationID )->update( $reservation );
|
||||
}
|
||||
|
||||
return $reservationID;
|
||||
}
|
||||
|
||||
public static function removeReservation( $reservationID )
|
||||
{
|
||||
Reservation::whereId( $reservationID )->delete();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user