mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
API can deal with attachments for more models. #2828
This commit is contained in:
@@ -645,4 +645,12 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
{
|
||||
return $account->locations()->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getAttachments(Account $account): Collection
|
||||
{
|
||||
return $account->attachments()->get();
|
||||
}
|
||||
}
|
||||
|
@@ -47,6 +47,13 @@ interface AccountRepositoryInterface
|
||||
*/
|
||||
public function count(array $types): int;
|
||||
|
||||
/**
|
||||
* @param Account $account
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getAttachments(Account $account): Collection;
|
||||
|
||||
/**
|
||||
* Get account location, if any.
|
||||
*
|
||||
|
@@ -479,4 +479,12 @@ class BudgetRepository implements BudgetRepositoryInterface
|
||||
$autoBudget->delete();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getAttachments(Budget $budget): Collection
|
||||
{
|
||||
return $budget->attachments()->get();
|
||||
}
|
||||
}
|
||||
|
@@ -39,6 +39,13 @@ interface BudgetRepositoryInterface
|
||||
*/
|
||||
public function destroyAll(): void;
|
||||
|
||||
/**
|
||||
* @param Budget $budget
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getAttachments(Budget $budget): Collection;
|
||||
|
||||
/**
|
||||
* @param Budget $budget
|
||||
*
|
||||
|
@@ -373,4 +373,12 @@ class CategoryRepository implements CategoryRepositoryInterface
|
||||
$category->delete();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getAttachments(Category $category): Collection
|
||||
{
|
||||
return $category->attachments()->get();
|
||||
}
|
||||
}
|
||||
|
@@ -38,6 +38,13 @@ interface CategoryRepositoryInterface
|
||||
*/
|
||||
public function destroyAll(): void;
|
||||
|
||||
/**
|
||||
* @param Category $category
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getAttachments(Category $category): Collection;
|
||||
|
||||
/**
|
||||
* @param Category $category
|
||||
*
|
||||
|
@@ -680,4 +680,12 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getAttachments(PiggyBank $piggyBank): Collection
|
||||
{
|
||||
return $piggyBank->attachments()->get();
|
||||
}
|
||||
}
|
||||
|
@@ -44,6 +44,13 @@ interface PiggyBankRepositoryInterface
|
||||
*/
|
||||
public function setCurrentAmount(PiggyBank $piggyBank, string $amount): PiggyBank;
|
||||
|
||||
/**
|
||||
* @param PiggyBank $piggyBank
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getAttachments(PiggyBank $piggyBank): Collection;
|
||||
|
||||
/**
|
||||
* @param PiggyBank $piggyBank
|
||||
* @param string $amount
|
||||
|
@@ -539,4 +539,12 @@ class TagRepository implements TagRepositoryInterface
|
||||
|
||||
return $min;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getAttachments(Tag $tag): Collection
|
||||
{
|
||||
return $tag->attachments()->get();
|
||||
}
|
||||
}
|
||||
|
@@ -39,6 +39,13 @@ interface TagRepositoryInterface
|
||||
*/
|
||||
public function count(): int;
|
||||
|
||||
/**
|
||||
* @param Tag $tag
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getAttachments(Tag $tag): Collection;
|
||||
|
||||
/**
|
||||
* This method destroys a tag.
|
||||
*
|
||||
|
Reference in New Issue
Block a user