37970-vm/api/v1/Models/Event.php
2026-01-30 16:28:00 +00:00

17 lines
392 B
PHP

<?php
namespace Api\Models;
use Api\Core\Model;
class Event extends Model {
protected static $table = 'events';
public static function getAllBySchool($schoolId) {
$db = db();
$stmt = $db->prepare("SELECT * FROM " . static::$table . " WHERE school_id = ? ORDER BY start_datetime ASC");
$stmt->execute([$schoolId]);
return $stmt->fetchAll();
}
}