2013-11-26 13:45:07 +01:00
|
|
|
<?php
|
|
|
|
|
2013-12-04 17:20:14 +01:00
|
|
|
class Payment extends EntityModel
|
2013-11-26 13:45:07 +01:00
|
|
|
{
|
|
|
|
public function invoice()
|
|
|
|
{
|
|
|
|
return $this->belongsTo('Invoice');
|
|
|
|
}
|
2013-12-01 21:58:25 +01:00
|
|
|
|
2013-12-07 19:45:00 +01:00
|
|
|
public function invitation()
|
|
|
|
{
|
|
|
|
return $this->belongsTo('Invitation');
|
|
|
|
}
|
|
|
|
|
2013-12-05 16:23:24 +01:00
|
|
|
public function client()
|
|
|
|
{
|
|
|
|
return $this->belongsTo('Client');
|
|
|
|
}
|
|
|
|
|
2014-01-29 11:41:38 +01:00
|
|
|
public function account()
|
|
|
|
{
|
|
|
|
return $this->belongsTo('Account');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function contact()
|
|
|
|
{
|
|
|
|
return $this->belongsTo('Contact');
|
|
|
|
}
|
|
|
|
|
2013-12-01 21:58:25 +01:00
|
|
|
public function getName()
|
|
|
|
{
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getEntityType()
|
|
|
|
{
|
|
|
|
return ENTITY_PAYMENT;
|
|
|
|
}
|
|
|
|
|
2013-11-26 22:45:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Payment::created(function($payment)
|
|
|
|
{
|
|
|
|
Activity::createPayment($payment);
|
2014-01-14 12:52:56 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
Payment::updating(function($payment)
|
|
|
|
{
|
|
|
|
Activity::updatePayment($payment);
|
|
|
|
});
|
|
|
|
|
|
|
|
Payment::deleting(function($payment)
|
|
|
|
{
|
|
|
|
Activity::archivePayment($payment);
|
2013-11-26 22:45:10 +01:00
|
|
|
});
|