fix: adds download preference to form

This commit is contained in:
2025-05-19 16:36:01 -05:00
parent 3c965aa1ec
commit f39e307bc4
4 changed files with 64 additions and 6 deletions

View File

@@ -281,6 +281,15 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
;
}
public function getDownloadPreferences()
{
return Map::from($this->userPreferences)
->rekey(fn(UserPreference $userPreference) => $userPreference->getPreference()->getId())
->filter(fn(UserPreference $userPreference) => $userPreference->getPreference()->getType() === 'download')
->toArray()
;
}
/**
* @return Collection<int, Download>
*/