public function setTranslatable(TranslatableInterface $translatable = null)
    {
        if ($translatable === $this->translatable) {
            return $this;
        }

        $previousTranslatable = $this->translatable;
        $this->translatable = $translatable;

        /** @var TranslationInterface $this */
        if (null !== $previousTranslatable) {
            $previousTranslatable->removeTranslation($this);
        }

        if (null !== $translatable) {
            $translatable->addTranslation($this);
        }

        return $this;
    }
public function setTranslatable(TranslatableInterface $translatable = null)
    {
        if ($translatable === $this->translatable) {
            return $this;
        }

        $previousTranslatable = $this->translatable;
        $this->translatable = $translatable;

        /** @var TranslationInterface $this */
        if (null !== $previousTranslatable) {
            $previousTranslatable->removeTranslation($this);
        }

        if (null !== $translatable) {
            $translatable->addTranslation($this);
        }

        return $this;
    }
public function setTranslatable ( TranslatableInterface $ translatable = null ) { if ( $ translatable === $ this -> translatable ) { return $ this ; } $ previousTranslatable = $ this -> translatable ; $ this -> translatable = $ translatable ; /** @var TranslationInterface $this */ if ( null !== $ previousTranslatable ) { $ previousTranslatable -> removeTranslation ( $ this ) ; } if ( null !== $ translatable ) { $ translatable -> addTranslation ( $ this ) ; } return $ this ; }
Sets the translatable.

@param TranslatableInterface $translatable
@return TranslationInterface|$this
Sets the translatable .