Skip to content

Instantly share code, notes, and snippets.

@acorncom
Last active December 16, 2015 16:29
Show Gist options
  • Save acorncom/5463701 to your computer and use it in GitHub Desktop.
Save acorncom/5463701 to your computer and use it in GitHub Desktop.
$items = array();
foreach($_POST['PO_LineItems'] as $item) {
$model = new PO_LineItem;
$model->setAttributes($item);
}
$poModel->LineItems = $items;
if($poModel->withRelated(true,array('LineItems'))) {
// everything is saved and we're ok
}
date_default_timezone_set('America/Denver');
// change the following paths as necessary for your particular setup
$yii=dirname(__FILE__).'/../yii/framework/yii.php';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment