-
Notifications
You must be signed in to change notification settings - Fork 124
Expand file tree
/
Copy pathResult.php
More file actions
166 lines (142 loc) · 3.06 KB
/
Copy pathResult.php
File metadata and controls
166 lines (142 loc) · 3.06 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<?php
namespace Ddeboer\DataImport;
use Ddeboer\DataImport\Exception\ExceptionInterface;
/**
* Simple Container for Workflow Results
*
* @author Aydin Hassan <aydin@hotmail.co.uk>
*/
class Result
{
/**
* Identifier given to the import/export
*
* @var string
*/
protected $name;
/**
* @var \DateTime
*/
protected $startTime;
/**
* @var \DateTime
*/
protected $endTime;
/**
* @var \DateInterval
*/
protected $elapsed;
/**
* @var integer
*/
protected $errorCount = 0;
/**
* @var integer
*/
protected $successCount = 0;
/**
* @var integer
*/
protected $totalProcessedCount = 0;
/**
* @var integer
*/
protected $skippedCount = 0;
/**
* @var \SplObjectStorage
*/
protected $exceptions;
/**
* @param string $name
* @param \DateTime $startTime
* @param \DateTime $endTime
* @param integer $processed
* @param integer $imported
* @param integer $skipped
* @param integer $errors
* @param \SplObjectStorage $exceptions
*/
public function __construct($name, \DateTime $startTime, \DateTime $endTime, $processed, $imported, $skipped, $errors, \SplObjectStorage $exceptions)
{
$this->name = $name;
$this->startTime = $startTime;
$this->endTime = $endTime;
$this->elapsed = $startTime->diff($endTime);
//Should expect $processed = $errors+$imported+$skipped
$this->totalProcessedCount = $processed;
$this->errorCount = $errors;
$this->successCount = $imported;
$this->skippedCount = $skipped;
$this->exceptions = $exceptions;
}
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @return \DateTime
*/
public function getStartTime()
{
return $this->startTime;
}
/**
* @return \DateTime
*/
public function getEndTime()
{
return $this->endTime;
}
/**
* @return \DateInterval
*/
public function getElapsed()
{
return $this->elapsed;
}
/**
* @return integer
*/
public function getErrorCount()
{
return $this->errorCount;
}
/**
* @return integer
*/
public function getSuccessCount()
{
return $this->successCount;
}
/**
* @return integer
*/
public function getTotalProcessedCount()
{
return $this->totalProcessedCount;
}
/**
* @return int
*/
public function getSkippedCount()
{
return $this->skippedCount;
}
/**
* @return boolean
*/
public function hasErrors()
{
return $this->errorCount > 0;
}
/**
* @return \SplObjectStorage
*/
public function getExceptions()
{
return $this->exceptions;
}
}