31 lines
632 B
PHP
31 lines
632 B
PHP
<?php
|
|
/*
|
|
Author: Riccardo Di Dato
|
|
Creation Date: 30/ago/2022
|
|
*/
|
|
|
|
|
|
class PageViewStatsModel extends Model {
|
|
|
|
public function __construct($saveableObject = null){
|
|
parent::__construct($saveableObject);
|
|
}
|
|
|
|
public static function getCollectionName(){
|
|
return "pageview_stats";
|
|
}
|
|
|
|
public static function getFilter($page, $day, $month, $year) {
|
|
$time = strtotime("$year-$month-$day CET");
|
|
return [
|
|
'page' => $page,
|
|
'time' => new MongoDB\BSON\UTCDateTime( $time * 1000 ),
|
|
'y' => intval($year),
|
|
'm' => intval($month),
|
|
'd' => intval($day)
|
|
];
|
|
}
|
|
|
|
}
|
|
|
|
?>
|