Skip to content

Instantly share code, notes, and snippets.

@enyachoke
Created November 25, 2012 16:13
Show Gist options
  • Save enyachoke/4144198 to your computer and use it in GitHub Desktop.
Save enyachoke/4144198 to your computer and use it in GitHub Desktop.
Readbean one to many
$invoice = R::dispense('invoice');
$invoice->Customer = 'Greg';
$lineItems = R::dispense('lineitem', 2);
$lineItems[0]->LineNumber = 1;
$lineItems[0]->Amount = 2.50;
$lineItems[1]->LineNumber = 2;
$lineItems[1]->Amount = 10.00;
$invoice->ownLineItem = $lineItems;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment