@param ArticleTranslation $translation

@return self
505658
public static function createFromArticleTranslation(ArticleTranslation $translation): self
    {
        $message = new self();
        $message->setLocale($translation->getLocale());
        $message->setTitle($translation->getTitle());
        $message->setBody($translation->getBody());

        return $message;
    }
217878
public function addTranslation(\Sulu\Bundle\ProductBundle\Entity\AttributeValueTranslation $translations)
    {
        $this->translations[] = $translations;

        return $this;
    }
544347
public function removeTranslation(\Haven\CmsBundle\Entity\HtmlContentTranslation $translations) {
        $this->translations->removeElement($translations);
    }
1310119
public function addTranslation(\Haven\CoreBundle\Entity\CultureTranslation $translations) {
        $this->translations[] = $translations;

        return $this;
    }
859133
private function translate(): self
    {
        if (empty($this->translations)) {
            return $this;
        }

        $lang = $this->get('lang');

        foreach ($this->attributes as $key => $attribute) {
            if (in_array($key, $this->translations, true)) {
                $this->set($key, __($attribute, [], $lang));
            }
        }

        return $this;
    }
798763
public function removeTranslation(LayoutTranslation $translation)
    {
        $this->translations->removeElement($translation);
        $translation->setLayout(null);
    }
1113872
public function setTranslator(\Symfony\Component\Translation\TranslatorInterface $translator)
    {
        $this->translator = $translator;

        return $this;
    }
985914
public function aliasPattern($pattern, $translation = null)
	{
		if ( ! is_array($pattern))
		{
			$pattern = [$pattern => $translation];
		}

		foreach ($pattern as $patternKey => $resolver)
		{
			if ( ! $resolver instanceof Resolver)
			{
				$resolver = new Resolver($patternKey, $resolver);
			}

			$this->patterns[$patternKey] = $resolver;
		}
	}
1029458
public function setTranslator(\Symfony\Component\Translation\Translator $translator)
    {
        $this->translator = $translator;
        return $this->translator;
    }
923108
public function addTranslation(Translation $translation)
    {
        $translation->setRepository($this);
        $this
            ->translationCollection
            ->addTranslation($translation);
    }
861275
public function addTranslation(Translation $translation, $isUpdate = true)
    {
        $this->translations[$translation->getLocale()] = $translation;
        if ($isUpdate) {
            $this->setIsModified(true);
        }
    }
333115
public static function createFromArticle(Article $article): self
    {
        $message = new self();
        $message->setId($article->getId());
        $message->setStatus($article->getStatus());
        $message->setMediaLimit($article->getMediaLimit());
        $message->setShareOnFacebook($article->isShareOnFacebook());

        $categoryIds = array_map(function (Category $category) {
            return $category->getId();
        }, $article->getCategories());

        $message->setCategoryIds($categoryIds);

        foreach ($article->getTranslations() as $translation) {
            $translationMessage = ArticleTranslationMessage::createFromArticleTranslation($translation);

            $message->addTranslation($translationMessage);
        }

        foreach ($article->getMedias() as $media) {
            $mediaMessage = ArticleMediaMessage::createFromArticleMedia($media);

            $message->addMedia($mediaMessage);
        }

        return $message;
    }
1092869
public function addTranslation(\Sulu\Bundle\Sales\ShippingBundle\Entity\ShippingStatusTranslation $translations)
    {
        $this->translations[] = $translations;
    
        return $this;
    }
606514
public function setNodeTranslation(\Kunstmaan\NodeBundle\Entity\NodeTranslation $nodeTranslation = null)
    {
        $this->nodeTranslation = $nodeTranslation;

        return $this;
    }
1176342
public function setCollation($collation)
    {
        if ($collation !== null) {
            $collation = $this->normalizeCollation($collation);
        }
        $this->collation = $collation;

        return $this;
    }
1049448
public function addTranslation(\Haven\CoreBundle\Entity\ExternalLinkTranslation $translations)
    {
        $translations->setParent($this);
        $this->translations[] = $translations;
    
        return $this;
    }
476649
public function set_translation(\Skeleton\I18n\Translation $translation) {
		if ($this->i18n_available === true) {
			$this->translation = $translation;
		} else {
			throw new \Exception('Translation is not available, class not found');
		}
	}