1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-22 17:31:35 +02:00
invoiceninja/app/Models/ExpenseCategory.php

52 lines
909 B
PHP
Raw Normal View History

2016-06-11 04:47:26 +02:00
<?php namespace App\Models;
use Illuminate\Database\Eloquent\SoftDeletes;
2016-09-13 10:50:03 +02:00
use Laracasts\Presenter\PresentableTrait;
2016-06-11 04:47:26 +02:00
/**
* Class ExpenseCategory
*/
2016-06-11 04:47:26 +02:00
class ExpenseCategory extends EntityModel
{
// Expense Categories
use SoftDeletes;
2016-09-13 10:50:03 +02:00
use PresentableTrait;
2016-06-11 04:47:26 +02:00
/**
* @var array
*/
2016-06-11 04:47:26 +02:00
protected $fillable = [
'name',
];
2016-09-13 10:50:03 +02:00
/**
* @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
}