Hi,
I have a problem in showing from sub models information that is in array..
I have 3 models (and tables); Reservation, ServiceCategorys and Services - where all the reservations are on it own main table (reservation_id, ect), the ServiceCategories (service_id, service_name) have the options that they can chose, and in the Services are the values for the services (id, reservation_id, service_id, service_value).
Services 'belongTo' (JOIN INNER) => ServiceCategories 'belongTo' (JOIN INNER) => Reservation
If i put on the 'Front list' PHP Functions;
to show that is there i get;
My head is not working today.. How i can print / show the values there..? Thanks.
How I can
I have a problem in showing from sub models information that is in array..
I have 3 models (and tables); Reservation, ServiceCategorys and Services - where all the reservations are on it own main table (reservation_id, ect), the ServiceCategories (service_id, service_name) have the options that they can chose, and in the Services are the values for the services (id, reservation_id, service_id, service_value).
Services 'belongTo' (JOIN INNER) => ServiceCategories 'belongTo' (JOIN INNER) => Reservation
If i put on the 'Front list' PHP Functions;
Reservation.Services: $temp = \GCore\Libs\Arr::getVal($row, array("Services", "[n]", "request_id"), array()); return print_r($temp );
to show that is there i get;
Array (
[id] => Array ( )
[service_id] => Array ( )
[reservation_id] => Array ( )
[service_value] => Array ( )
)
My head is not working today.. How i can print / show the values there..? Thanks.
How I can
Hi casals,
Can you try this to see what data is available:
Bob
Can you try this to see what data is available:
Reservation.Services: return print_r($row );
Hopefully that will give you clues about a. if there is any data and b. what the structure is.
Bob
Hi, Thank you for your prompt reply.
I still have some problems in reading / getting information from sub models, specially if there is more than one record matching the search (aka user = group). Its working fine in "belongsTo" relation.. but if i change the relation to "HasMany", then I get errors all the time (Even with new models for testing). No idea why. Is there any documentation on CC5 and "HasMany" relations?
The main problem its very simple; Like in User = Groups relations, i need to read and print the information about all the groups (names) to where the user belongs. But for some reason, this seems to be too hard..
I still have some problems in reading / getting information from sub models, specially if there is more than one record matching the search (aka user = group). Its working fine in "belongsTo" relation.. but if i change the relation to "HasMany", then I get errors all the time (Even with new models for testing). No idea why. Is there any documentation on CC5 and "HasMany" relations?
The main problem its very simple; Like in User = Groups relations, i need to read and print the information about all the groups (names) to where the user belongs. But for some reason, this seems to be too hard..
This topic is locked and no more replies can be posted.