/** * {@inheritDoc} */ public function save(FormFlowInterface $flow, array $data) { // handle file uploads if ($flow->isHandleFileUploads()) { array_walk_recursive($data, function (&$value, $key) { if (SerializableFile::isSupported($value)) { $value = new SerializableFile($value); } }); } // drop old data $this->drop($flow); // save new data $savedFlows = $this->storage->get(DataManagerInterface::STORAGE_ROOT, array()); $savedFlows = array_merge_recursive($savedFlows, array($flow->getName() => array($flow->getInstanceId() => array(self::DATA_KEY => $data)))); $this->storage->set(DataManagerInterface::STORAGE_ROOT, $savedFlows); }
public function testIsSupported() { $this->assertTrue(SerializableFile::isSupported(new UploadedFile(__FILE__, basename(__FILE__)))); $this->assertFalse(SerializableFile::isSupported(new File(__FILE__))); }