1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 22:54:25 +01:00
invoiceninja/app/Models/ProposalSnippet.php

85 lines
1.5 KiB
PHP
Raw Normal View History

2018-01-30 19:58:55 +01:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\SoftDeletes;
use Laracasts\Presenter\PresentableTrait;
/**
* Class ExpenseCategory.
*/
class ProposalSnippet extends EntityModel
{
use SoftDeletes;
use PresentableTrait;
/**
* @var array
*/
protected $dates = ['deleted_at'];
/**
* @var array
*/
protected $fillable = [
2018-02-01 10:24:53 +01:00
'name',
2018-02-04 22:03:26 +01:00
'icon',
2018-02-01 10:24:53 +01:00
'private_notes',
2018-02-04 16:16:55 +01:00
'proposal_category_id',
2018-02-04 20:34:38 +01:00
'html',
'css',
2018-01-30 19:58:55 +01:00
];
/**
* @var string
*/
2018-02-12 14:03:12 +01:00
protected $presenter = 'App\Ninja\Presenters\ProposalSnippetPresenter';
2018-01-30 19:58:55 +01:00
/**
* @return mixed
*/
public function getEntityType()
{
return ENTITY_PROPOSAL_SNIPPET;
}
/**
* @return string
*/
public function getRoute()
{
2018-01-31 13:21:33 +01:00
return "/proposals/snippets/{$this->public_id}";
2018-01-30 19:58:55 +01:00
}
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function account()
{
return $this->belongsTo('App\Models\Account');
}
2018-02-04 16:16:55 +01:00
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function proposal_category()
{
return $this->belongsTo('App\Models\ProposalCategory')->withTrashed();
}
2018-01-30 19:58:55 +01:00
public function getDisplayName()
{
return $this->name;
}
}
/*
Proposal::creating(function ($project) {
$project->setNullValues();
});
Proposal::updating(function ($project) {
$project->setNullValues();
});
*/