Change signature of importstorage.

This commit is contained in:
James Cole
2016-08-26 06:47:12 +02:00
parent 4c015e2d12
commit 78912903ce
2 changed files with 15 additions and 3 deletions

View File

@@ -88,9 +88,8 @@ class ImportProcedure
$cleaned = $validator->clean();
// then import collection:
$storage = new ImportStorage($cleaned);
$storage = new ImportStorage($job->user, $cleaned);
$storage->setJob($job);
$storage->setUser($job->user);
// and run store routine:
$result = $storage->store();

View File

@@ -40,14 +40,20 @@ class ImportStorage
/** @var User */
public $user;
/** @var Collection */
private $rules;
/**
* ImportStorage constructor.
*
* @param User $user
* @param Collection $entries
*/
public function __construct(Collection $entries)
public function __construct(User $user, Collection $entries)
{
$this->entries = $entries;
$this->user = $user;
$this->rules = $this->getUserRules();
}
@@ -124,6 +130,13 @@ class ImportStorage
return $tag;
}
/**
* @return Collection
*/
private function getUserRules(): Collection
{
}
/**
* @param float $amount
*