src/Serializer.php
public function unserialize(TranslatableInterface $translatable, $targetLang, $xliff, $callSetData = TRUE) {
    // First, validate the provided xliff.
    if ($this->validateImport($translatable, $targetLang, $xliff)) {
      // If valid, return the imported data as an array.
      $data = $this->import($xliff);

      // Call TranslatableInterface::setData() on the translatable if desired.
      if ($callSetData) {
        $translatable->setData($data, $targetLang);
      }

      return $data;
    }
    else {
      // If there was an error, return an empty array.
      return array();
    }
  }
public function unserialize(TranslatableInterface $translatable, $targetLang, $xliff, $callSetData = TRUE) {
    // First, validate the provided xliff.
    if ($this->validateImport($translatable, $targetLang, $xliff)) {
      // If valid, return the imported data as an array.
      $data = $this->import($xliff);

      // Call TranslatableInterface::setData() on the translatable if desired.
      if ($callSetData) {
        $translatable->setData($data, $targetLang);
      }

      return $data;
    }
    else {
      // If there was an error, return an empty array.
      return array();
    }
  }
public function unserialize ( TranslatableInterface $ translatable , $ targetLang , $ xliff , $ callSetData = TRUE ) { // First, validate the provided xliff. if ( $ this -> validateImport ( $ translatable , $ targetLang , $ xliff ) ) { // If valid, return the imported data as an array. $ data = $ this -> import ( $ xliff ) ; // Call TranslatableInterface::setData() on the translatable if desired. if ( $ callSetData ) { $ translatable -> setData ( $ data , $ targetLang ) ; } return $ data ; } else { // If there was an error, return an empty array. return array ( ) ; } }
Unserializes given XLIFF data; before unserialization occurs, the provided
XLIFF is also validated against the provided translatable and target
language.

@param TranslatableInterface $translatable
The translatable against which validation will occur.

@param $targetLang
The language code of the target language (used for validation).

@param string $xliff
XLIFF data to be unserialized.

@param bool $callSetData
(Optional) Whether or not to call the setData method on the provided
translatable. Defaults to TRUE, pass FALSE to disable the setter call.

@return array
Returns unserialized data as an array in the exact same form that was
provided via the translatable's getData method. If there was an error
unserializing the provided XLIFF, an empty array will be returned.
Unserializes given XLIFF data ; before unserialization occurs the provided XLIFF is also validated against the provided translatable and target language .