Skip to content

Instantly share code, notes, and snippets.

@richardDobron
Created July 11, 2022 18:19
Show Gist options
  • Save richardDobron/6402efaed0c5aa5feb14307fd22427ed to your computer and use it in GitHub Desktop.
Save richardDobron/6402efaed0c5aa5feb14307fd22427ed to your computer and use it in GitHub Desktop.
<?php
namespace App;
use fbt\Transform\FbtTransform\Translate\IntlVariations;
use fbt\Lib\IntlViewerContextInterface;
use fbt\Runtime\Gender;
class UserDTO implements IntlViewerContextInterface
{
public function getLocale(): ?string
{
return $this->locale;
}
public static function getGender(): int
{
if ($this->gender === 'male') {
return IntlVariations::GENDER_MALE;
}
if ($this->gender === 'female') {
return IntlVariations::GENDER_FEMALE;
}
return IntlVariations::GENDER_UNKNOWN;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment