blob: f98cd6294750938ddcfa875c86c9758f798ad127 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
class_name TimeSlot
class TimeSlot_data:
var id
var schedule_id
var start_time
var end_time
var name
var date_completed
func _init(record):
self.id = record['id']
self.schedule_id = record['schedule_id']
self.start_time = record['start_time']
self.end_time = record['end_time']
self.name = record['name']
self.date_completed = record['date_completed']
static func get_by_schedule_name(schedule_name):
var records = DBMS.query("""
SELECT "TimeSlots".* FROM "TimeSlots"
JOIN "Schedules" ON "TimeSlots".schedule_id = "Schedules".id
WHERE "Schedules".name = ?
ORDER BY "TimeSlots".start_time
""",
[schedule_name])
var timeslots = []
for record in records:
timeslots.push_back(TimeSlot_data.new(record))
return timeslots
|