Esempio n. 1
0
 /**
  * @param array $data
  * @param string $lang
  */
 function export(array $data, $lang)
 {
     foreach ($data as $sheet => $array) {
         if ($sheet == 'sitem') {
             $sheet = 'item';
         }
         $ext = $this->encoder->name();
         $filename = "{$this->path}/words_{$lang}_{$sheet}.{$ext}";
         file_put_contents($filename, $this->encoder->encode($array));
     }
 }
Esempio n. 2
0
 /**
  * Turn an object graph into a string
  *
  * @param mixed $value
  * @return string
  */
 public function serialize($value)
 {
     $this->navigator->accept($this->navigator, $this->visitor, $value);
     $result = $this->visitor->getResult();
     return $this->encoder->encode($result);
 }
Esempio n. 3
0
 /**
  * {@inheritDoc}
  */
 public function encode($value)
 {
     return $this->encoder->encode($value);
 }