public function export($emotionId) { $zip =
new ZipArchive();
$name =
$this->connection->
fetchColumn('SELECT name FROM s_emotion WHERE id = :id',
[':id' =>
$emotionId]);
$name =
strtolower($this->slug->
slugify($name));
$filename =
$this->rootDirectory . '/files/downloads/' .
$name .
time() . '.zip';
if ($zip->
open($filename, ZipArchive::CREATE
) !== true
) { throw new Exception(sprintf('Could not create zip file "%s"!',
$filename));
} $emotionData =
$this->transformer->
transform($emotionId, true
);
$preset =
$this->
createHiddenPreset($emotionData);
$preset =
$this->synchronizer->
prepareAssetExport($preset);