1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-23 18:01:35 +02:00
invoiceninja/app/models/Invoice.php

41 lines
680 B
PHP
Raw Normal View History

2013-11-26 13:45:07 +01:00
<?php
2013-12-04 17:20:14 +01:00
class Invoice extends EntityModel
2013-11-26 13:45:07 +01:00
{
2013-12-05 16:23:24 +01:00
protected $hidden = array('id', 'account_id', 'client_id', 'created_at', 'updated_at', 'deleted_at', 'viewed_date');
2013-12-03 18:32:33 +01:00
2013-12-01 21:58:25 +01:00
public function account()
{
return $this->belongsTo('Account');
}
2013-11-26 13:45:07 +01:00
public function client()
{
return $this->belongsTo('Client');
}
public function invoice_items()
{
return $this->hasMany('InvoiceItem');
}
2013-12-01 08:33:17 +01:00
public function invoice_status()
{
return $this->belongsTo('InvoiceStatus');
}
2013-12-01 21:58:25 +01:00
public function getName()
{
return $this->invoice_number;
}
public function getEntityType()
{
return ENTITY_INVOICE;
}
2013-11-26 22:45:10 +01:00
}
Invoice::created(function($invoice)
{
Activity::createInvoice($invoice);
});