mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-15 07:33:04 +01:00
72 lines
1.2 KiB
PHP
72 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
use Laracasts\Presenter\PresentableTrait;
|
|
|
|
/**
|
|
* Class ExpenseCategory.
|
|
*/
|
|
class ProposalCategory extends EntityModel
|
|
{
|
|
use SoftDeletes;
|
|
use PresentableTrait;
|
|
|
|
/**
|
|
* @var array
|
|
*/
|
|
protected $dates = ['deleted_at'];
|
|
|
|
/**
|
|
* @var array
|
|
*/
|
|
protected $fillable = [
|
|
'name',
|
|
];
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
//protected $presenter = 'App\Ninja\Presenters\ProjectPresenter';
|
|
|
|
/**
|
|
* @return mixed
|
|
*/
|
|
public function getEntityType()
|
|
{
|
|
return ENTITY_PROPOSAL_CATEGORY;
|
|
}
|
|
|
|
/**
|
|
* @return string
|
|
*/
|
|
public function getRoute()
|
|
{
|
|
return "/proposals/categories/{$this->public_id}";
|
|
}
|
|
|
|
/**
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
*/
|
|
public function account()
|
|
{
|
|
return $this->belongsTo('App\Models\Account');
|
|
}
|
|
|
|
public function getDisplayName()
|
|
{
|
|
return $this->name;
|
|
}
|
|
}
|
|
|
|
/*
|
|
Proposal::creating(function ($project) {
|
|
$project->setNullValues();
|
|
});
|
|
|
|
Proposal::updating(function ($project) {
|
|
$project->setNullValues();
|
|
});
|
|
*/
|