1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 16:31:33 +02:00
invoiceninja/app/models/Credit.php

31 lines
473 B
PHP
Raw Normal View History

2013-12-01 21:58:25 +01:00
<?php
class Credit extends Eloquent implements iEntity
{
protected $softDelete = true;
2013-12-03 18:32:33 +01:00
public function scopeScope($query)
{
return $query->whereAccountId(Auth::user()->account_id);
}
2013-12-01 21:58:25 +01:00
public function invoice()
{
return $this->belongsTo('Invoice');
}
public function getName()
{
return $this->credit_number;
}
public function getEntityType()
{
return ENTITY_CREDIT;
}
}
Credit::created(function($credit)
{
Activity::creaateCredit($credit);
});