Jan 14
Marc Pinnell Got to be an easier way.... Arrays, maps and pairs, oh my!
Jan 14, 2015; 15:00
Marc Pinnell
Got to be an easier way.... Arrays, maps and pairs, oh my!
A little background. Working on a reservation system for soccer field space. Each field has four sections or quadrants that can be reserved either one at a time, 2 or all four. Working with 30 minute time blocks. Trying to figure out the most efficient way to get the data into a format that I can then use to build a table to display open and reserved "sections/quads". Currently working with the code (I stripped out a bunch of non-relevant, for this discussion, code) below for a single soccer field:
var(fieldInfo = array)
var(quadInfo = map)
$quadInfo->insert(
'nw' = map('label'=false,'custID'='--Open nw--','status'=''),
'ne' = map('label'=false,'custID'='--Open ne--','status'=''),
'sw' = map('label'=false,'custID'='--Open sw--','status'=''),
'se' = map('label'=false,'custID'='--Open se--','status'='')
)
$fieldInfo->insert(pair($curTime->format('kk:mm') = $quadInfo))
with oneSlot in $fieldInfo do {^
// To get the current time slot
#oneSlot->first
// To get the customer ID from the first "quadrant" of the field
#oneSlot->second->find('nw')->find('custID')
^}
It just seems like the "#oneSlot->second->find('nw')->find('custID')" code is really cumbersome and "not pretty". Is there a better way to get at that info as I step through the time blocks? Maybe there is a more efficient way to "build" my info for display instead of a mish-mash of pairs and maps? This is somewhat simplified as the map will eventually have about a dozen bits of info I believe.
Any thoughts?
Marc Pinnell
1027 Design
PO Box 990872
Redding, CA 96099-0872
530.941.4706
fax: 866.232.5300
www.1027Design.com
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso Lasso@lists.lassosoft.com
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>
Jan 14
Steve Piercy - Website Builder Re: Got to be an easier way.... Arrays, maps and pairs, oh my!
Jan 14, 2015; 16:05
Steve Piercy - Website Builder
Re: Got to be an easier way.... Arrays, maps and pairs, oh my!
Jan 15
Brad Lindsay Re: Got to be an easier way.... Arrays, maps and pairs, oh my!
Jan 15, 2015; 12:17
Brad Lindsay
Re: Got to be an easier way.... Arrays, maps and pairs, oh my!
Jan 15
Marc Pinnell Re: Got to be an easier way.... Arrays, maps and pairs, oh my!
Jan 15, 2015; 13:11
Marc Pinnell
Re: Got to be an easier way.... Arrays, maps and pairs, oh my!
Jan 15
Marc Pinnell Re: Got to be an easier way.... Arrays, maps and pairs, oh my!
Jan 15, 2015; 16:30
Marc Pinnell
Re: Got to be an easier way.... Arrays, maps and pairs, oh my!
Jan 15
Brad Lindsay Re: Got to be an easier way.... Arrays, maps and pairs, oh my!
Jan 15, 2015; 22:35
Brad Lindsay
Re: Got to be an easier way.... Arrays, maps and pairs, oh my!
Jan 15
Marc Pinnell Re: Got to be an easier way.... Arrays, maps and pairs, oh my!
Jan 15, 2015; 21:02
Marc Pinnell
Re: Got to be an easier way.... Arrays, maps and pairs, oh my!
Jan 16
Jolle Carlestam Re: Got to be an easier way.... Arrays, maps and pairs, oh my!
Jan 16, 2015; 11:40
Jolle Carlestam
Re: Got to be an easier way.... Arrays, maps and pairs, oh my!
Jan 17
Bil Corry Re: Got to be an easier way.... Arrays, maps and pairs, oh my!
Jan 17, 2015; 03:28
Bil Corry
Re: Got to be an easier way.... Arrays, maps and pairs, oh my!