I'm new to CakePHP, but I think I'm starting to figure it out. I am trying to recursively display information about related tables, but I want to specify which related models should perform recursion. Let me give an example to demonstrate my goal:
I have a “Client” model that has information like company name, website, etc. The "Client" has many "Addresses" that contain information for individual contacts, such as "Contact Name", "Street", "City", "Country", "Country", etc. "Customer" also belongs to "CustomerType", which has only descriptive category information - name and description, for example, "Distributor" or "Manufacturer".
When I find “Customer”, I want the related information “CustomerType” and “Address” as sub-arrays, and this works great by setting up hasMany and assigning associations correctly. But now, here is my problem: I want to get information about the country / country. So, instead of each row of the Address array having "state_id", I want it to have "state" => array ("id" = 20, "name" = "New York", ...) and t .d.
If I set $ recursive to a higher value (for example, 2) in the Partner model, I get what I want for the state / country information in each "address". BUT it also recurses to "CustomerType", and this leads to the "CustomerType" field of my "Partner" object, which has a huge array of all Customer objects that correspond to this type, which may be thousands.
So the thing is that I do NOT want to return "CustomerType", only to "Address". Can i install this?
Sorry for the old question and thanks in advance!