location = $location; } /** * @return UserPreference[] */ public function getPreferences(): array { return $this->preferences; } public function addPreference(UserPreference $preference) { $this->preferences[] = $preference; } /** * If you want to filter where the preference will be displayed, check the current location. * * @return string */ public function getLocation(): string { return $this->location; } }