Skip to content

Commit

Permalink
savebatch prep work
Browse files Browse the repository at this point in the history
  • Loading branch information
jsalisbury committed Apr 4, 2017
1 parent 28fc295 commit 720d848
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions api/routes/rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,24 @@
];
$response = $response->withJSON($response_json);
return $response;
});

$app->post('/rules/saveBatch/{catId}', function($request, $response) {
// $theRules = json_decode($request->getParam("batchObj"));
// $cat = $request->getAttribute('catId');
// foreach ($theRules as $r):
// $rule = new CategoryRankNutrient;
// $rule->findPk($r['ruleId'];
// $rule->setThreshold($r['threshold']);
// $rule->setUnits($r['units']));
// $rule->setOperator($r['operator']);
// $rule->setCategoryId($cat);
// $rule->setRankId($r['rankId']);
// $rule->setNutrientId($r['nutrientId']);
// $rule->save();
// endforeach;

print_r($request);


});

0 comments on commit 720d848

Please sign in to comment.