| 1 | <?php |
||
| 7 | class ProcessingProgressEvent extends Event |
||
| 8 | { |
||
| 9 | |||
| 10 | private $source = null; |
||
| 11 | |||
| 12 | private $destination = null; |
||
| 13 | |||
| 14 | private $file = null; |
||
| 15 | |||
| 16 | private $progress = null; |
||
| 17 | |||
| 18 | 9 | public function __construct(AbstractAdapter $source, AbstractAdapter $destination, $file, $progress) |
|
| 19 | { |
||
| 20 | 9 | $this->source = $source; |
|
| 21 | 9 | $this->destination = $destination; |
|
| 22 | 9 | $this->file = $file; |
|
| 23 | |||
| 24 | 9 | $progress = (int)$progress; |
|
| 25 | 9 | if ($progress < 0) { |
|
| 26 | 1 | $progress = 0; |
|
| 27 | } |
||
| 28 | 9 | if ($progress > 100) { |
|
| 29 | 1 | $progress = 100; |
|
| 30 | } |
||
| 31 | 9 | $this->progress = $progress; |
|
| 32 | 9 | } |
|
| 33 | |||
| 34 | 2 | public function getSource() |
|
| 38 | |||
| 39 | 1 | public function getDestination() |
|
| 43 | |||
| 44 | 3 | public function getFile() |
|
| 48 | |||
| 49 | 6 | public function getProgress() |
|
| 53 | } |
||
| 54 |