1 <?php
2
3 namespace PLus\Orders\Repositories\Config;
4
5 6 7 8 9
10 class Parameters extends \Nette\Object {
11
12 protected $maxsizeupload;
13 protected $from;
14 protected $support;
15 protected $version;
16 protected $newslimit;
17
18
19
20 function __construct($maxsizeupload, $from, $support, $version, $newslimit) {
21 $this->maxsizeupload = $maxsizeupload;
22 $this->from = $from;
23 $this->support = $support;
24 $this->version = $version;
25 $this->newslimit = $newslimit;
26 }
27
28
29
30 public function getMaxSizeUpload() {
31 return $this->maxsizeupload;
32 }
33
34 function getFrom() {
35 return $this->from;
36 }
37
38
39 function getSupport() {
40 return $this->support;
41 }
42
43 function getVersion() {
44 return $this->version;
45 }
46
47 function getNewsLimit() {
48 return $this->newslimit;
49 }
50
51
52
53 54 55 56 57 58 59
60 function formatBytes($bytes, $precision = 2) {
61 $units = array('B', 'KB', 'MB', 'GB', 'TB');
62
63 $bytes = max($bytes, 0);
64 $pow = floor(($bytes ? log($bytes) : 0) / log(1024));
65 $pow = min($pow, count($units) - 1);
66 $bytes /= pow(1024, $pow);
67
68 return round($bytes, $precision) . ' ' . $units[$pow];
69 }
70 }
71