mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-11 21:52:35 +01:00
41 lines
680 B
PHP
Executable File
41 lines
680 B
PHP
Executable File
<?php
|
|
|
|
class Invoice extends EntityModel
|
|
{
|
|
protected $hidden = array('id', 'account_id', 'client_id', 'created_at', 'updated_at', 'deleted_at', 'viewed_date');
|
|
|
|
public function account()
|
|
{
|
|
return $this->belongsTo('Account');
|
|
}
|
|
|
|
public function client()
|
|
{
|
|
return $this->belongsTo('Client');
|
|
}
|
|
|
|
public function invoice_items()
|
|
{
|
|
return $this->hasMany('InvoiceItem');
|
|
}
|
|
|
|
public function invoice_status()
|
|
{
|
|
return $this->belongsTo('InvoiceStatus');
|
|
}
|
|
|
|
public function getName()
|
|
{
|
|
return $this->invoice_number;
|
|
}
|
|
|
|
public function getEntityType()
|
|
{
|
|
return ENTITY_INVOICE;
|
|
}
|
|
}
|
|
|
|
Invoice::created(function($invoice)
|
|
{
|
|
Activity::createInvoice($invoice);
|
|
}); |