poc form SDK (extends to form)

This commit is contained in:
Benjamin Dalsass
2023-08-24 14:29:31 +02:00
parent 245c1d0be5
commit 20ae64706a
3325 changed files with 1500 additions and 547966 deletions

View File

@@ -0,0 +1,31 @@
<?php
namespace Combodo\iTop\DI\Form\Transformer;
use ormDocument;
use Symfony\Component\Form\DataTransformerInterface;
/**
* Perform transformation between ormDocument and UploadedFile.
*/
class DocumentTransformer implements DataTransformerInterface
{
/** @inheritdoc */
public function transform($value)
{
return null;
}
/** @inheritdoc */
public function reverseTransform($value)
{
if($value === null){
return null;
}
$doc_content = file_get_contents($value->getRealPath());
return new ormDocument($doc_content, $value->getClientMimeType(), $value->getRealPath());
}
}