mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-06 14:12:15 +00:00
Fix #1452.
This commit is contained in:
@@ -336,7 +336,6 @@ class TagRepository implements TagRepositoryInterface
|
||||
}
|
||||
)
|
||||
->groupBy(['tags.id', 'tags.tag']);
|
||||
|
||||
// add date range (or not):
|
||||
if (null === $year) {
|
||||
Log::debug('Get tags without a date.');
|
||||
@@ -464,4 +463,13 @@ class TagRepository implements TagRepositoryInterface
|
||||
{
|
||||
return $this->user->tags()->find($tagId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Will return the newest tag (if known) or NULL.
|
||||
*
|
||||
* @return Tag|null
|
||||
*/
|
||||
public function newestTag(): ?Tag
|
||||
{
|
||||
return $this->user->tags()->whereNotNull('date')->orderBy('date', 'DESC')->first();
|
||||
}}
|
||||
|
||||
@@ -116,10 +116,16 @@ interface TagRepositoryInterface
|
||||
public function lastUseDate(Tag $tag): Carbon;
|
||||
|
||||
/**
|
||||
* Will return the newest tag (if known) or NULL.
|
||||
* @return Tag|null
|
||||
*/
|
||||
public function oldestTag(): ?Tag;
|
||||
|
||||
/**
|
||||
* Will return the newest tag (if known) or NULL.
|
||||
* @return Tag|null
|
||||
*/
|
||||
public function newestTag(): ?Tag;
|
||||
/**
|
||||
* @param User $user
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user