-
Notifications
You must be signed in to change notification settings - Fork 249
Expand file tree
/
Copy pathTaskWrapperFactory.class.php
More file actions
82 lines (72 loc) · 1.81 KB
/
Copy pathTaskWrapperFactory.class.php
File metadata and controls
82 lines (72 loc) · 1.81 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
<?php
namespace DBA;
class TaskWrapperFactory extends AbstractModelFactory {
function getModelName() {
return "TaskWrapper";
}
function getModelTable() {
return "TaskWrapper";
}
function isCachable() {
return false;
}
function getCacheValidTime() {
return -1;
}
/**
* @return TaskWrapper
*/
function getNullObject() {
$o = new TaskWrapper(-1, null, null, null, null, null, null, null, null, null);
return $o;
}
/**
* @param string $pk
* @param array $dict
* @return TaskWrapper
*/
function createObjectFromDict($pk, $dict) {
$o = new TaskWrapper($dict['taskWrapperId'], $dict['priority'], $dict['maxAgents'], $dict['taskType'], $dict['hashlistId'], $dict['accessGroupId'], $dict['taskWrapperName'], $dict['isArchived'], $dict['cracked'], $dict['userId']);
return $o;
}
/**
* @param array $options
* @param bool $single
* @return TaskWrapper|TaskWrapper[]
*/
function filter($options, $single = false) {
$join = false;
if (array_key_exists('join', $options)) {
$join = true;
}
if ($single) {
if ($join) {
return parent::filter($options, $single);
}
return Util::cast(parent::filter($options, $single), TaskWrapper::class);
}
$objects = parent::filter($options, $single);
if ($join) {
return $objects;
}
$models = array();
foreach ($objects as $object) {
$models[] = Util::cast($object, TaskWrapper::class);
}
return $models;
}
/**
* @param string $pk
* @return TaskWrapper
*/
function get($pk) {
return Util::cast(parent::get($pk), TaskWrapper::class);
}
/**
* @param TaskWrapper $model
* @return TaskWrapper
*/
function save($model) {
return Util::cast(parent::save($model), TaskWrapper::class);
}
}