1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 12:42:36 +01:00
invoiceninja/app/Models/ExpenseCategory.php

53 lines
910 B
PHP
Raw Normal View History

2017-01-30 20:40:43 +01:00
<?php
namespace App\Models;
2016-06-11 04:47:26 +02:00
use Illuminate\Database\Eloquent\SoftDeletes;
use Laracasts\Presenter\PresentableTrait;
2016-06-11 04:47:26 +02:00
/**
2017-01-30 20:40:43 +01:00
* Class ExpenseCategory.
*/
2016-06-11 04:47:26 +02:00
class ExpenseCategory extends EntityModel
{
// Expense Categories
use SoftDeletes;
use PresentableTrait;
2016-06-11 04:47:26 +02:00
/**
* @var array
*/
2016-06-11 04:47:26 +02:00
protected $fillable = [
'name',
];
/**
* @var string
*/
protected $presenter = 'App\Ninja\Presenters\EntityPresenter';
2016-07-06 20:35:16 +02:00
/**
* @return mixed
*/
public function getEntityType()
{
return ENTITY_EXPENSE_CATEGORY;
}
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
2016-06-11 04:47:26 +02:00
public function expense()
{
return $this->belongsTo('App\Models\Expense');
}
2016-07-06 20:35:16 +02:00
/**
* @return string
*/
public function getRoute()
{
return "/expense_categories/{$this->public_id}/edit";
}
2016-07-05 20:49:47 +02:00
}