Move models to proper ProcessMaker Model namespace.

This commit is contained in:
Taylor Dondich
2019-04-25 13:54:39 -07:00
committed by Paula Quispe
parent 6b8065a98f
commit 9aec728509
7 changed files with 31 additions and 30 deletions

View File

@@ -1,17 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Process extends Model
{
/**
* Retrieve all applications that belong to this process
*/
public function applications()
{
return $this->hasMany(Application::class, 'PRO_ID', 'PRO_ID');
}
}

View File

@@ -1,10 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Task extends Model
{
//
}

View File

@@ -1,6 +1,6 @@
<?php
namespace App\Models;
namespace ProcessMaker\Model;
use Illuminate\Database\Eloquent\Model;

View File

@@ -1,6 +1,6 @@
<?php
namespace App\Models;
namespace ProcessMaker\Model;
use Illuminate\Database\Eloquent\Model;

View File

@@ -17,5 +17,13 @@ class Process extends Model
// We do have a created at, but we don't store an updated at
const CREATED_AT = 'PRO_CREATE_DATE';
const UPDATED_AT = null;
/**
* Retrieve all applications that belong to this process
*/
public function applications()
{
return $this->hasMany(Application::class, 'PRO_ID', 'PRO_ID');
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace ProcessMaker\Model;
use Illuminate\Database\Eloquent\Model;
class Task extends Model
{
protected $table = 'TASK';
public function process()
{
return $this->belongsTo(Process::class, 'PRO_UID', 'PRO_UID');
}
public function delegations()
{
return $this->hasMany(Delegation::class, 'TAS_ID', 'TAS_ID');
}
}

View File

@@ -1,6 +1,6 @@
<?php
namespace App\Models;
namespace ProcessMaker\Model;
use Illuminate\Database\Eloquent\Model;