wip-feat: populates filter from api options

This commit is contained in:
2025-04-29 22:10:47 -05:00
parent c3eaf109e3
commit 8a1a89f17d
9 changed files with 191 additions and 6 deletions

View File

@@ -2,6 +2,7 @@
namespace App\User\Framework\Entity;
use Aimeos\Map;
use App\User\Framework\Repository\PreferencesRepository;
use App\User\Framework\Repository\UserRepository;
use Doctrine\Common\Collections\ArrayCollection;
@@ -184,4 +185,12 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
return $this;
}
public function getUserPreferenceValues()
{
return Map::from($this->userPreferences)
->rekey(fn(UserPreference $userPreference) => $userPreference->getPreference()->getId())
->map(fn(UserPreference $userPreference) => $userPreference->getPreferenceValue())
->toArray();
}
}