comparison core/modules/statistics/src/StatisticsViewsResult.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children c2387f117808
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
1 <?php
2
3 namespace Drupal\statistics;
4
5 /**
6 * Value object for passing statistic results.
7 */
8 class StatisticsViewsResult {
9
10 /**
11 * @var int
12 */
13 protected $totalCount;
14
15 /**
16 * @var int
17 */
18 protected $dayCount;
19
20 /**
21 * @var int
22 */
23 protected $timestamp;
24
25 public function __construct($total_count, $day_count, $timestamp) {
26 $this->totalCount = $total_count;
27 $this->dayCount = $day_count;
28 $this->timestamp = $timestamp;
29 }
30
31 /**
32 * Total number of times the entity has been viewed.
33 *
34 * @return int
35 */
36 public function getTotalCount() {
37 return $this->totalCount;
38 }
39
40
41 /**
42 * Total number of times the entity has been viewed "today".
43 *
44 * @return int
45 */
46 public function getDayCount() {
47 return $this->dayCount;
48 }
49
50
51 /**
52 * Timestamp of when the entity was last viewed.
53 *
54 * @return int
55 */
56 public function getTimestamp() {
57 return $this->timestamp;
58 }
59
60 }