More code for import routine.

This commit is contained in:
James Cole
2018-05-07 20:35:14 +02:00
parent 626f7357bb
commit 7f4feb0cfc
8 changed files with 380 additions and 50 deletions

View File

@@ -153,6 +153,18 @@ class CategoryRepository implements CategoryRepositoryInterface
return $firstJournalDate;
}
/**
* Get all categories with ID's.
*
* @param array $categoryIds
*
* @return Collection
*/
public function getByIds(array $categoryIds): Collection
{
return $this->user->categories()->whereIn('id', $categoryIds)->get();
}
/**
* Returns a list of all the categories belonging to a user.
*

View File

@@ -32,6 +32,7 @@ use Illuminate\Support\Collection;
*/
interface CategoryRepositoryInterface
{
/**
* @param Category $category
*
@@ -84,6 +85,15 @@ interface CategoryRepositoryInterface
*/
public function firstUseDate(Category $category): ?Carbon;
/**
* Get all categories with ID's.
*
* @param array $categoryIds
*
* @return Collection
*/
public function getByIds(array $categoryIds): Collection;
/**
* Returns a list of all the categories belonging to a user.
*