projecten
This commit is contained in:
@@ -8,11 +8,33 @@
|
||||
|
||||
class Payment extends BaseModel {
|
||||
|
||||
protected $table = "projects";
|
||||
protected $table = "payments";
|
||||
|
||||
public function offer()
|
||||
{
|
||||
return $this->belongsTo( 'Offer' );
|
||||
}
|
||||
|
||||
public static function savePayment( $paymentID, $payment )
|
||||
{
|
||||
$payment = (array) $payment;
|
||||
|
||||
if ( $paymentID == 0 )
|
||||
{
|
||||
$payment = Payment::create( $payment );
|
||||
$paymentID = $payment['id'];
|
||||
}
|
||||
else
|
||||
{
|
||||
Payment::whereId( $paymentID )->update( $payment );
|
||||
}
|
||||
|
||||
return $paymentID;
|
||||
}
|
||||
|
||||
public static function removePayment( $paymentID )
|
||||
{
|
||||
Payment::whereId( $paymentID )->delete();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user