I am new to cake and was wondering if someone could help point me in the right direction. I am trying to create something similar to a weekly planner with additional rules. Each user has many "time blocks" that they can enter (something like a punch clock where you enter a start and end time of your block). Depending on what the user selects, each time block has different validation rules that apply to that block. For instance a new time block is added that starts at 5:00 a.m. and stops at 5:00 p.m. The user has selected a "10 hour rule" from the input form. What I need is to be able to validate that there is 10 hours before this "time block" that doesn't have another time block in it. I also need to check any existing time blocks that might have different rules attached. For example an existing block may end 11 hours before the one being validated and added but the previous block may have a rule that does not allow anything 12 hours after. This would invalidate the existing block and not allow the current one to be saved.
I think this isn't really "business logic" that would go into a controller but rather data validation that should go into the model. I just don't know how to construct the parameters, the mysql query part nor how to set it up in the model. Do I create a function that goes into the $validate array? How would the mysql query be setup there? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
