/** * @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)); } }
/** * 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); }
/** * {@inheritDoc} */ public function encode($value) { return $this->encoder->encode($value); }