Hello,
I've got a simple timetable - a set of events. Every event has set its hour and day (and at one time there can be more events). Now I am trying to print them out in a table: With dibi I used to use fetchAssoc('day,hour') (or similar) to get array like this:
<?php
array(
'1' /* day */ => array(
'1' /* hour */ => array( array(...) /* event */, array(...) /* event */ ),
'2' /* hour */ => array( array(...) /* event */ )
)
);
?>
I want to get the same array structure with NotORM, but it doesn't have fetchAssoc() method. Is it possible to get array (or traverse database entries) like this or do I have to write my own solution? Or should I try to solve this problem in a completly different way?
I was suggested to rebuild my database structure, but only thing I was able to came with was making own table for days (7 rows) and for hours (7*24 rows) and then selecting days, join hours, join events; although it actually makes sense, it isn't satisfying - imagine extending the application's time scope to year instead of a week…
Thank you
PS: I'm actually using Nette\Database, but I guess there won't be much difference. Here's my original post on Nette forum
http://forum.nette.org/en/911-nette-database-equivalent-to-dibi-s-fetchassoc