/** * @see BackendAdapter::createFile */ public function createFile(File $file, Folder $folder) { $id = $this->conn->getDatabasePlatform()->getName() == 'mysql' ? null : $this->conn->fetchColumn($this->conn->getDatabasePlatform()->getSequenceNextValSQL('xi_filelib_file_id_seq')); $this->conn->insert('xi_filelib_file', array('id' => $id, 'folder_id' => $folder->getId(), 'fileprofile' => $file->getProfile(), 'filename' => $file->getName(), 'date_created' => $file->getDateCreated()->format('Y-m-d H:i:s'), 'status' => $file->getStatus(), 'uuid' => $file->getUuid(), 'resource_id' => $file->getResource()->getId(), 'data' => json_encode($file->getdata()->toArray()))); $id = $this->conn->getDatabasePlatform()->getName() == 'mysql' ? $this->conn->lastInsertId() : $id; $file->setId($id); $file->setFolderId($folder->getId()); return $file; }