public function __construct(TranslationKeyModel $key, $withPhrases = false)
 {
     $this->id = $key->getId();
     $this->identifier = (string) $key->getIdentifier();
     $this->resourceId = $key->getResource()->getId();
     if ($withPhrases) {
         foreach ($key->getPhrases() as $phrase) {
             $locale = $phrase->getLocale();
             $this->phrases[(string) $locale] = new TranslationPhrase($phrase);
         }
     }
 }