projecten

This commit is contained in:
2018-01-23 08:45:44 +01:00
parent 970aa53971
commit fb19c401fd
36 changed files with 1402 additions and 184 deletions
+23 -1
View File
@@ -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();
}
}