2019-04-25 13:54:39 -07:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace ProcessMaker\Model;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
class Task extends Model
|
|
|
|
|
{
|
|
|
|
|
protected $table = 'TASK';
|
2019-05-09 14:56:36 -04:00
|
|
|
protected $primaryKey = 'TAS_ID';
|
2019-04-25 14:15:41 -07:00
|
|
|
// We do not have create/update timestamps for this table
|
2019-04-25 17:46:02 -04:00
|
|
|
public $timestamps = false;
|
2019-04-25 13:54:39 -07:00
|
|
|
|
|
|
|
|
public function process()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Process::class, 'PRO_UID', 'PRO_UID');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function delegations()
|
|
|
|
|
{
|
|
|
|
|
return $this->hasMany(Delegation::class, 'TAS_ID', 'TAS_ID');
|
|
|
|
|
}
|
2019-05-13 16:44:40 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Scope a query to only include self-service
|
|
|
|
|
*
|
|
|
|
|
* @param \Illuminate\Database\Eloquent\Builder $query
|
|
|
|
|
* @return \Illuminate\Database\Eloquent\Builder
|
|
|
|
|
*/
|
|
|
|
|
public function scopeIsSelfService($query)
|
|
|
|
|
{
|
|
|
|
|
return $query->where('TAS_ASSIGN_TYPE', '=', 'SELF_SERVICE')
|
|
|
|
|
->where('TAS_GROUP_VARIABLE', '=', '');
|
|
|
|
|
}
|
2019-04-25 13:54:39 -07:00
|
|
|
}
|