I'm trying to write a cakephp app. I need to validate input based on availability. an example would be if someone is trying to take out a book from a library. I would reference the book to see if it's currently out, and if it is report that to the user.
another example would be trying to book rooms at a hotel, the user would enter a date and a length of their visit, and the function would check to see if that room is available for that length of time.
I'm writing this in the controller, but I'm confused about how to a) grab the data I need from the database, and b) how to pass that data between functions. I know how I would do this using php/mysql but I'm not familiar with cakephp and I can't find a tutorial that just goes over the basics.
edit: i think i got it down, i'll update in a bit.