Files
luos/workflow/engine/src/ProcessMaker/Model/ListUnassigned.php

129 lines
2.9 KiB
PHP
Raw Normal View History

2019-05-09 14:56:36 -04:00
<?php
namespace ProcessMaker\Model;
use Illuminate\Database\Eloquent\Model;
use ListUnassigned as PropelListUnassigned;
class ListUnassigned extends Model
{
protected $table = "LIST_UNASSIGNED";
// No timestamps
public $timestamps = false;
/**
* Returns the application this belongs to
*/
public function application()
{
return $this->belongsTo(Application::class, 'APP_UID', 'APP_UID');
}
/**
* Return the process task this belongs to
*/
public function task()
{
return $this->belongsTo(Task::class, 'TAS_ID', 'TAS_ID');
}
/**
* Return the process this belongs to
*/
public function process()
{
return $this->belongsTo(Process::class, 'PRO_ID', 'PRO_ID');
}
2019-06-06 16:43:42 -04:00
/**
* Return the user this belongs to
*/
public function previousUser()
{
return $this->belongsTo(User::class, 'DEL_PREVIOUS_USR_UID', 'USR_UID');
}
2019-05-13 16:44:40 -04:00
/**
* Scope a query to only include specific tasks
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param array $tasks
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeTasksIn($query, array $tasks)
{
return $query->whereIn('TAS_ID', $tasks);
}
/**
* Scope a query to only include a specific case
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param integer $appNumber
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeCase($query, $appNumber)
{
return $query->where('APP_NUMBER', '=', $appNumber);
}
/**
* Scope a query to only include a specific index
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param integer $index
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeIndex($query, $index)
{
return $query->where('DEL_INDEX', '=', $index);
}
/**
* Scope a query to only include a specific task
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @param integer $task
*
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopeTask($query, $task)
{
return $query->where('TAS_ID', '=', $task);
}
2019-05-09 14:56:36 -04:00
/**
* Get count
*
* @param string $userUid
* @param array $filters
*
* @return array
2019-06-06 16:43:42 -04:00
*/
2019-05-09 14:56:36 -04:00
public static function doCount($userUid, $filters = [])
{
$list = new PropelListUnassigned();
$result = $list->getCountList($userUid, $filters);
return $result;
}
/**
* Search data
*
* @param string $userUid
* @param array $filters
*
* @return array
*/
public static function loadList($userUid, $filters = [])
{
$list = new PropelListUnassigned();
$result = $list->loadList($userUid, $filters);
return $result;
}
}