A customer has many orders. (one to many relationship) What I want to do is this :
$order = Order::find_by_id(3);
echo $order->customer;
How do I set up the models to be able to do this?
A customer has many orders. (one to many relationship) What I want to do is this :
$order = Order::find_by_id(3);
echo $order->customer;
How do I set up the models to be able to do this?
Copyright © 2021 Jogjafile Inc.
The correct way to do a one to many relationship is (e.g. customer 1 <-----> * orders)
This was not clear from the php active record documentation.