@@ 20-131 (lines=112) @@ | ||
17 | * Class DriverStatistic |
|
18 | * @package phpFastCache\Entities |
|
19 | */ |
|
20 | class DriverStatistic |
|
21 | { |
|
22 | /** |
|
23 | * @var string |
|
24 | */ |
|
25 | protected $info = ''; |
|
26 | ||
27 | /** |
|
28 | * @var string |
|
29 | */ |
|
30 | protected $size = 0; |
|
31 | ||
32 | /** |
|
33 | * @var string |
|
34 | */ |
|
35 | protected $data = ''; |
|
36 | ||
37 | /** |
|
38 | * @var mixed |
|
39 | */ |
|
40 | protected $rawData; |
|
41 | ||
42 | /** |
|
43 | * @return string|bool Return infos or false if no information available |
|
44 | */ |
|
45 | public function getInfo() |
|
46 | { |
|
47 | return $this->info; |
|
48 | } |
|
49 | ||
50 | /** |
|
51 | * @return int|bool Return size in octet or false if no information available |
|
52 | */ |
|
53 | public function getSize() |
|
54 | { |
|
55 | return $this->size; |
|
56 | } |
|
57 | ||
58 | /** |
|
59 | * @return mixed |
|
60 | */ |
|
61 | public function getData() |
|
62 | { |
|
63 | return $this->data; |
|
64 | } |
|
65 | ||
66 | /** |
|
67 | * @param $info |
|
68 | * @return $this |
|
69 | */ |
|
70 | public function setInfo($info) |
|
71 | { |
|
72 | $this->info = ($info ?: ''); |
|
73 | ||
74 | return $this; |
|
75 | } |
|
76 | ||
77 | ||
78 | /** |
|
79 | * @param int $size |
|
80 | * @return $this |
|
81 | */ |
|
82 | public function setSize($size) |
|
83 | { |
|
84 | $this->size = ($size ?: 0); |
|
85 | ||
86 | return $this; |
|
87 | } |
|
88 | ||
89 | /** |
|
90 | * @param mixed $data |
|
91 | * @return $this |
|
92 | */ |
|
93 | public function setData($data) |
|
94 | { |
|
95 | $this->data = ($data ?: ''); |
|
96 | ||
97 | return $this; |
|
98 | } |
|
99 | ||
100 | /** |
|
101 | * @return mixed |
|
102 | */ |
|
103 | public function getRawData() |
|
104 | { |
|
105 | return $this->rawData; |
|
106 | } |
|
107 | ||
108 | /** |
|
109 | * @param mixed $raw |
|
110 | * @return $this |
|
111 | */ |
|
112 | public function setRawData($raw) |
|
113 | { |
|
114 | $this->rawData = $raw; |
|
115 | ||
116 | return $this; |
|
117 | } |
|
118 | ||
119 | /** |
|
120 | * @return array |
|
121 | */ |
|
122 | public function getPublicDesc() |
|
123 | { |
|
124 | return[ |
|
125 | 'Info' => 'Cache Information', |
|
126 | 'Size' => 'Cache Size', |
|
127 | 'Data' => 'Cache items keys', |
|
128 | 'RawData' => 'Cache raw data', |
|
129 | ]; |
|
130 | } |
|
131 | } |
@@ 20-131 (lines=112) @@ | ||
17 | * Class DriverStatistic |
|
18 | * @package phpFastCache\Entities |
|
19 | */ |
|
20 | class DriverStatistic |
|
21 | { |
|
22 | /** |
|
23 | * @var string |
|
24 | */ |
|
25 | protected $info = ''; |
|
26 | ||
27 | /** |
|
28 | * @var string |
|
29 | */ |
|
30 | protected $size = 0; |
|
31 | ||
32 | /** |
|
33 | * @var string |
|
34 | */ |
|
35 | protected $data = ''; |
|
36 | ||
37 | /** |
|
38 | * @var mixed |
|
39 | */ |
|
40 | protected $rawData; |
|
41 | ||
42 | /** |
|
43 | * @return string|bool Return infos or false if no information available |
|
44 | */ |
|
45 | public function getInfo() |
|
46 | { |
|
47 | return $this->info; |
|
48 | } |
|
49 | ||
50 | /** |
|
51 | * @return int|bool Return size in octet or false if no information available |
|
52 | */ |
|
53 | public function getSize() |
|
54 | { |
|
55 | return $this->size; |
|
56 | } |
|
57 | ||
58 | /** |
|
59 | * @return mixed |
|
60 | */ |
|
61 | public function getData() |
|
62 | { |
|
63 | return $this->data; |
|
64 | } |
|
65 | ||
66 | /** |
|
67 | * @param $info |
|
68 | * @return $this |
|
69 | */ |
|
70 | public function setInfo($info) |
|
71 | { |
|
72 | $this->info = ($info ?: ''); |
|
73 | ||
74 | return $this; |
|
75 | } |
|
76 | ||
77 | ||
78 | /** |
|
79 | * @param int $size |
|
80 | * @return $this |
|
81 | */ |
|
82 | public function setSize($size) |
|
83 | { |
|
84 | $this->size = ($size ?: 0); |
|
85 | ||
86 | return $this; |
|
87 | } |
|
88 | ||
89 | /** |
|
90 | * @param mixed $data |
|
91 | * @return $this |
|
92 | */ |
|
93 | public function setData($data) |
|
94 | { |
|
95 | $this->data = ($data ?: ''); |
|
96 | ||
97 | return $this; |
|
98 | } |
|
99 | ||
100 | /** |
|
101 | * @return mixed |
|
102 | */ |
|
103 | public function getRawData() |
|
104 | { |
|
105 | return $this->rawData; |
|
106 | } |
|
107 | ||
108 | /** |
|
109 | * @param mixed $raw |
|
110 | * @return $this |
|
111 | */ |
|
112 | public function setRawData($raw) |
|
113 | { |
|
114 | $this->rawData = $raw; |
|
115 | ||
116 | return $this; |
|
117 | } |
|
118 | ||
119 | /** |
|
120 | * @return array |
|
121 | */ |
|
122 | public function getPublicDesc() |
|
123 | { |
|
124 | return[ |
|
125 | 'Info' => 'Cache Information', |
|
126 | 'Size' => 'Cache Size', |
|
127 | 'Data' => 'Cache items keys', |
|
128 | 'RawData' => 'Cache raw data', |
|
129 | ]; |
|
130 | } |
|
131 | } |