I'm trying to write an app for managing some of rental properties.
Here is a basic outline of the models I'm trying to work with right
now. I'm working on making the functions in my model to handle
paginating the results.
A - Campus
id
HABTM Building
B - CampusesBuilding
campus_id
building_id
distance
C - Building
HABTM Campus
hasMany Units
D - Unit
belongsTo Building
building_id
rent
beds
baths
I'm trying to use a findAll and specify conditions on Campus,
CampusesBuilding, and Unit. Specifically, I'm providing a Campus
.id, CampusesBuilding.distance, and Unit.rent/beds/baths.
I'm trying this by writing the custom paginate, and paginateCount
functions on the Unit. I can get it to work fine until I try adding
the condition that relates to the distance field. Once I add the
distance field, I get the "unknown field" error, for
CampusesBuilding.distance. I'm collecting all the conditions and
passing them all to the paginate function. Is there some intermediate
step I should be doing, or maybe starting from the other end.
Should just performing paginate on Unit work? $this->Unit-
>paginate($allconditions....) , or should I start at the Campus? $this-
>Campus->CampusesBuilding->Building->Unit->findAll($cond...) Maybe it
doesn't matter.
Is this something that will improve if I upgrade to a newer version of
CakePHP? I'm on version 1.2.0.5427alpha.
Any help would be appreciated. If you need more specfics, like the
actual models I have set up, I can probably put together a
bin for it all.
Thanks,
Bob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---