mirror of
https://codeberg.org/vlw/vlw.se.git
synced 2025-11-05 07:02:41 +01:00
This PR refactors some texts on the about page (again), and also a adds two new endpoints for a database table that I have now made public that tracks the coffee cups I've had. The endpoint itself is not public now but I might make a page (something like `/about/coffee`) that presents it in a not-ugly way. Reviewed-on: https://codeberg.org/vlw/vlw.se/pulls/28
32 lines
No EOL
795 B
PHP
32 lines
No EOL
795 B
PHP
<?php
|
|
|
|
namespace VLW\Database\Models\Coffee;
|
|
|
|
use \VV;
|
|
|
|
use VLW\API\Endpoints;
|
|
use VLW\Database\Models\Model;
|
|
use VLW\Database\Tables\Coffee\StatsTable;
|
|
|
|
require_once VV::root("src/API/Endpoints.php");
|
|
require_once VV::root("src/Database/Models/Model.php");
|
|
require_once VV::root("src/Database/Tables/Coffee/Stats.php");
|
|
require_once VV::root("src/Database/Models/Coffee/Stats.php");
|
|
|
|
class Stats extends Model {
|
|
public function __construct() {
|
|
parent::__construct(Endpoints::COFFEE_STATS);
|
|
}
|
|
|
|
public static function all(array $params = []): array {
|
|
return [];
|
|
}
|
|
|
|
public function week(): int {
|
|
return $this->get(StatsTable::COUNT_WEEK->value) ?? 0;
|
|
}
|
|
|
|
public function week_average(): int {
|
|
return $this->get(StatsTable::COUNT_WEEK_AVERAGE->value) ?? 0;
|
|
}
|
|
} |