-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProcessBase_Model.php
More file actions
135 lines (110 loc) · 2.86 KB
/
Copy pathProcessBase_Model.php
File metadata and controls
135 lines (110 loc) · 2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?php
/*******************************************************************************
*
* @author : Dominik Bonsch <[email protected]>
* @date :
* @copyright : Webfrap Developer Network <[email protected]>
* @project : Webfrap Web Frame Application
* @projectUrl : http://webfrap.net
*
* @licence : BSD License see: LICENCE/BSD Licence.txt
*
* @version: @package_version@ Revision: @package_revision@
*
* Changes:
*
*******************************************************************************/
/**
* @package WebFrap
* @subpackage Core
* @author Dominik Bonsch
* @copyright Dominik Bonsch <[email protected]>
*/
class ProcessBase_Model extends Model
{
/*//////////////////////////////////////////////////////////////////////////////
// Attributes
//////////////////////////////////////////////////////////////////////////////*/
/**
* Prozess Id
* @var int
*/
public $processId = null;
/**
* Key zum laden der passenden Entity
* @var string
*/
public $entityKey = null;
/**
* Die Id der Entity
* @var int
*/
public $entityId = null;
/**
* Die Entity
* @var Entity
*/
public $entity = null;
/*//////////////////////////////////////////////////////////////////////////////
// Getter & Setter
//////////////////////////////////////////////////////////////////////////////*/
/**
* @param int $processId
*/
public function setProcessId($processId)
{
$this->processId = $processId;
}//end public function setProcessId */
/**
* @param string $entityKey
*/
public function setEntityKey($entityKey)
{
$this->entityKey = $entityKey;
}//end public function setEntityKey */
/**
* @param int $entityId
*/
public function setEntityId($entityId)
{
$this->entityId = $entityId;
}//end public function setEntityId */
/**
* @param string $entityKey
* @param int $entityId
*/
public function loadEntity($entityKey, $entityId)
{
$this->entityKey = $entityKey;
$this->entityId = $entityId;
$entityKey = SParserString::subToCamelCase($this->entityKey);
$this->entity = $this->getDb()->getOrm()->get(
$entityKey,
$this->entityId
);
}//end public function loadEntity */
/**
* @param int $processId
* @return ProcessBase_Query
*/
public function getProcessEdges($processId)
{
$query = $this->getDb()->newQuery('ProcessBase');
$query->fetchProcessEdges($processId);
return $query;
}//end public function getProcessEdges */
/**
* @return Entity
*/
public function getEntity()
{
if (!$this->entity) {
$entityKey = SParserString::subToCamelCase($this->entityKey);
$this->entity = $this->getDb()->getOrm()->get(
$entityKey,
$this->entityId
);
}
return $this->entity;
}//end public function getEntity */
} // end class ProcessBase_Model