mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
87 lines
3.0 KiB
PHP
87 lines
3.0 KiB
PHP
<?php
|
|
/**
|
|
* Invoice Ninja (https://invoiceninja.com).
|
|
*
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
*
|
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
|
*
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Utils\Traits\MakesHash;
|
|
|
|
/**
|
|
* App\Models\Proposal
|
|
*
|
|
* @property-read \App\Models\User|null $assigned_user
|
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
* @property-read int|null $documents_count
|
|
* @property-read mixed $hashed_id
|
|
* @property-read mixed $proposal_id
|
|
* @property-read \App\Models\User $user
|
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel company()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel exclude($columns)
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Proposal newModelQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Proposal newQuery()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|Proposal query()
|
|
* @method static \Illuminate\Database\Eloquent\Builder|BaseModel scope()
|
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Document> $documents
|
|
* @mixin \Eloquent
|
|
*/
|
|
class Proposal extends BaseModel
|
|
{
|
|
use MakesHash;
|
|
|
|
protected $guarded = [
|
|
'id',
|
|
];
|
|
|
|
protected $touches = [];
|
|
|
|
public function getEntityType()
|
|
{
|
|
return self::class;
|
|
}
|
|
|
|
protected $appends = ['proposal_id'];
|
|
|
|
public function getRouteKeyName()
|
|
{
|
|
return 'proposal_id';
|
|
}
|
|
|
|
public function getProposalIdAttribute()
|
|
{
|
|
return $this->encodePrimaryKey($this->id);
|
|
}
|
|
|
|
public function documents()
|
|
{
|
|
return $this->morphMany(Document::class, 'documentable');
|
|
}
|
|
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class)->withTrashed();
|
|
}
|
|
|
|
public function assigned_user()
|
|
{
|
|
return $this->belongsTo(User::class, 'assigned_user_id', 'id');
|
|
}
|
|
}
|