1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 22:22:32 +01:00
invoiceninja/app/Models/PaymentTerm.php

43 lines
690 B
PHP
Raw Normal View History

2017-01-30 20:40:43 +01:00
<?php
namespace App\Models;
2015-03-16 22:45:25 +01:00
use Cache;
2016-01-07 20:39:51 +01:00
use Illuminate\Database\Eloquent\SoftDeletes;
2015-03-25 20:56:31 +01:00
/**
2017-01-30 20:40:43 +01:00
* Class PaymentTerm.
*/
2016-01-07 20:39:51 +01:00
class PaymentTerm extends EntityModel
2015-03-16 22:45:25 +01:00
{
use SoftDeletes;
/**
* @var bool
*/
2016-01-07 20:39:51 +01:00
public $timestamps = true;
/**
* @var array
*/
2016-01-07 20:39:51 +01:00
protected $dates = ['deleted_at'];
/**
* @return mixed
*/
2016-01-07 20:39:51 +01:00
public function getEntityType()
{
return ENTITY_PAYMENT_TERM;
}
public static function getSelectOptions()
{
$terms = Cache::get('paymentTerms');
foreach (PaymentTerm::scope()->get() as $term) {
$terms->push($term);
}
return $terms->sortBy('num_days');
}
2015-03-16 22:45:25 +01:00
}