1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 16:31:33 +02:00
invoiceninja/app/Models/Task.php

84 lines
1.7 KiB
PHP
Raw Normal View History

<?php
2019-05-11 05:32:07 +02:00
/**
* Invoice Ninja (https://invoiceninja.com).
2019-05-11 05:32:07 +02:00
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
2019-05-11 05:32:07 +02:00
*
* @license https://opensource.org/licenses/AAL
*/
namespace App\Models;
2020-10-12 22:42:02 +02:00
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;
2020-10-12 22:42:02 +02:00
use Filterable;
protected $fillable = [
'client_id',
'invoice_id',
2020-10-12 22:42:02 +02:00
'project_id',
2020-10-28 00:02:32 +01:00
'assigned_user_id',
'custom_value1',
'custom_value2',
2020-10-12 22:42:02 +02:00
'custom_value3',
'custom_value4',
'description',
'is_running',
'time_log',
2020-10-26 20:10:04 +01:00
'status_id',
'status_sort_order',
2020-10-27 03:27:38 +01:00
'invoice_documents',
];
2020-07-23 05:55:11 +02:00
protected $touches = [];
public function getEntityType()
{
return self::class;
}
public function company()
{
return $this->belongsTo(Company::class);
}
2019-04-28 07:31:32 +02:00
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);
}
2020-10-12 22:42:02 +02:00
public function invoice()
{
return $this->belongsTo(Invoice::class);
}
public function project()
{
return $this->belongsTo(Project::class);
}
}