1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 08:51:34 +02:00
invoiceninja/app/Models/Task.php
David Bomba 8f53424017 Fixes
2020-10-27 06:10:04 +11:00

82 lines
1.6 KiB
PHP

<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://opensource.org/licenses/AAL
*/
namespace App\Models;
use App\Models\Filterable;
use App\Utils\Traits\MakesHash;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Task extends BaseModel
{
use MakesHash;
use SoftDeletes;
use Filterable;
protected $fillable = [
'client_id',
'invoice_id',
'project_id',
'custom_value1',
'custom_value2',
'custom_value3',
'custom_value4',
'description',
'is_running',
'time_log',
'status_id',
'status_sort_order',
];
protected $touches = [];
public function getEntityType()
{
return self::class;
}
public function company()
{
return $this->belongsTo(Company::class);
}
public function documents()
{
return $this->morphMany(Document::class, 'documentable');
}
public function assigned_user()
{
return $this->belongsTo(User::class, 'assigned_user_id', 'id')->withTrashed();
}
public function user()
{
return $this->belongsTo(User::class);
}
public function client()
{
return $this->belongsTo(Client::class);
}
public function invoice()
{
return $this->belongsTo(Invoice::class);
}
public function project()
{
return $this->belongsTo(Project::class);
}
}