I'm storing a product Bean, by this way:
$product = R::dispense( 'product' );
$product->name = $_POST['name'];
$product->description = $_POST['description'];
$product->price = $_POST['price'];
$product->category = $_POST['category'];
R::store( $product );
How can I indicate that the category's attribute is an id reference (or FK) to the category Bean? I want get the category Bean like this way:
$products = R::find( 'product' );
foreach( $products as $product )
$productCategory = $product->category->name;