Files
dbois/application/models/eloquent/Reservation.php
T
2018-03-07 17:03:45 +01:00

38 lines
796 B
PHP

<?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();
}
}