mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 16:17:32 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			55 lines
		
	
	
		
			793 B
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			55 lines
		
	
	
		
			793 B
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
	
	
| <?php
 | |
| 
 | |
| class Payment extends EntityModel
 | |
| {
 | |
| 	public function invoice()
 | |
| 	{
 | |
| 		return $this->belongsTo('Invoice')->withTrashed();;
 | |
| 	}
 | |
| 
 | |
| 	public function invitation()
 | |
| 	{
 | |
| 		return $this->belongsTo('Invitation');
 | |
| 	}
 | |
| 
 | |
| 	public function client()
 | |
| 	{
 | |
| 		return $this->belongsTo('Client')->withTrashed();;
 | |
| 	}
 | |
| 
 | |
| 	public function account()
 | |
| 	{
 | |
| 		return $this->belongsTo('Account');
 | |
| 	}
 | |
| 
 | |
| 	public function contact()
 | |
| 	{
 | |
| 		return $this->belongsTo('Contact');
 | |
| 	}
 | |
| 
 | |
| 	public function getName()
 | |
| 	{
 | |
| 		return '';
 | |
| 	}
 | |
| 
 | |
| 	public function getEntityType()
 | |
| 	{
 | |
| 		return ENTITY_PAYMENT;
 | |
| 	}	
 | |
| 
 | |
| }
 | |
| 
 | |
| Payment::created(function($payment)
 | |
| {
 | |
| 	Activity::createPayment($payment);
 | |
| });
 | |
| 
 | |
| Payment::updating(function($payment)
 | |
| {
 | |
| 	Activity::updatePayment($payment);
 | |
| });
 | |
| 
 | |
| Payment::deleting(function($payment)
 | |
| {
 | |
| 	Activity::archivePayment($payment);
 | |
| }); |