This method will update the field mapped to Locale if it does not match the $locale argument.
public bindTranslation ( object $document, string $locale ) | ||
$document | object | the document to persist a translation of |
$locale | string | the locale this document currently has |
/** * {@inheritDoc} */ public function bindTranslation($document, $locale) { if (!is_object($document)) { throw new InvalidArgumentException('Parameter $document needs to be an object, ' . gettype($document) . ' given'); } $this->errorIfClosed(); $this->unitOfWork->bindTranslation($document, $locale); }
/** * Bind the translatable fields of the document in the specified locale. * * This method will update the @Locale field if it does not match the $locale argument. * * @param $document the document to persist a translation of * @param $locale the locale this document currently has * * @throws PHPCRException if the document is not translatable */ public function bindTranslation($document, $locale) { if (!is_object($document)) { throw new \InvalidArgumentException(gettype($document)); } $this->errorIfClosed(); $this->unitOfWork->bindTranslation($document, $locale); }
/** * Bind the translatable fields of the document in the specified locale. * * This method will update the @Locale field if it does not match the $locale argument. * * @param $object the document to persist a translation of * @param $locale the locale this document currently has * * @throws PHPCRException if the document is not translatable */ public function bindTranslation($object, $locale) { $this->errorIfClosed(); $this->unitOfWork->bindTranslation($object, $locale); }