Skip to content

Commit

Permalink
Dev Testable version of participant import.
Browse files Browse the repository at this point in the history
  • Loading branch information
SamMousa committed Jun 2, 2015
1 parent 5697023 commit 30118e9
Show file tree
Hide file tree
Showing 8 changed files with 998 additions and 88 deletions.
3 changes: 3 additions & 0 deletions application/components/Batch.php
Expand Up @@ -12,6 +12,7 @@ class Batch {

protected $defaultCategory;
public $batchSize;
public $commitCount = 0;
protected $data = [];

public function __construct(Closure $callback, $batchSize = 5000, $defaultCategory = 'default') {
Expand Down Expand Up @@ -41,8 +42,10 @@ public function add($elements, $category = null) {
}

public function commitCategory($category) {

$callback = $this->callback;
$callback($this->data[$category], $category);
$this->commitCount++;
unset($this->data[$category]);
}
public function commit() {
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/Controller.php
Expand Up @@ -188,7 +188,7 @@ protected function loadModel($id) {

public function getActionParams()
{
return array_merge($_GET, $_POST);
return App()->request->psr7->getParsedBody();
}


Expand Down

0 comments on commit 30118e9

Please sign in to comment.