mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 08:57:33 -05:00 
			
		
		
		
	
		
			
				
	
	
		
			85 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			85 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?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 = [
 | 
						|
        'name',
 | 
						|
        'icon',
 | 
						|
        'private_notes',
 | 
						|
        'proposal_category_id',
 | 
						|
        'html',
 | 
						|
        'css',
 | 
						|
    ];
 | 
						|
 | 
						|
    /**
 | 
						|
     * @var string
 | 
						|
     */
 | 
						|
    protected $presenter = 'App\Ninja\Presenters\ProposalSnippetPresenter';
 | 
						|
 | 
						|
    /**
 | 
						|
     * @return mixed
 | 
						|
     */
 | 
						|
    public function getEntityType()
 | 
						|
    {
 | 
						|
        return ENTITY_PROPOSAL_SNIPPET;
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * @return string
 | 
						|
     */
 | 
						|
    public function getRoute()
 | 
						|
    {
 | 
						|
        return "/proposals/snippets/{$this->public_id}";
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
 | 
						|
     */
 | 
						|
    public function account()
 | 
						|
    {
 | 
						|
        return $this->belongsTo('App\Models\Account');
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
 | 
						|
     */
 | 
						|
    public function proposal_category()
 | 
						|
    {
 | 
						|
        return $this->belongsTo('App\Models\ProposalCategory')->withTrashed();
 | 
						|
    }
 | 
						|
 | 
						|
    public function getDisplayName()
 | 
						|
    {
 | 
						|
        return $this->name;
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
/*
 | 
						|
Proposal::creating(function ($project) {
 | 
						|
    $project->setNullValues();
 | 
						|
});
 | 
						|
 | 
						|
Proposal::updating(function ($project) {
 | 
						|
    $project->setNullValues();
 | 
						|
});
 | 
						|
*/
 |