Created
April 3, 2016 09:50
-
-
Save mix5003/508552d20e8a03dd0e6f521bcc3821fc to your computer and use it in GitHub Desktop.
Example Logic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //Just a dummy | |
| $customer = CustomerRepo::first(); | |
| $products = ProductRepo::limit(3)->get(); //return array of products | |
| $order = new Order(); | |
| $order->setCustomer($customer); | |
| $order->setProducts($products); | |
| $dm->persist($order); | |
| $dm->flush(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //Just a dummy | |
| $order = OrderRepo::first(); | |
| $dm->remove($order); | |
| $dm->flush(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment