/**
  * @see BackendAdapter::createFolder
  */
 public function createFolder(Folder $folder)
 {
     $id = $this->conn->getDatabasePlatform()->getName() == 'mysql' ? null : $this->conn->fetchColumn($this->conn->getDatabasePlatform()->getSequenceNextValSQL('xi_filelib_folder_id_seq'));
     $this->conn->insert('xi_filelib_folder', array('id' => $id, 'parent_id' => $folder->getParentId(), 'foldername' => $folder->getName(), 'folderurl' => $folder->getUrl(), 'uuid' => $folder->getUuid(), 'data' => json_encode($folder->getdata()->toArray())));
     $id = $this->conn->getDatabasePlatform()->getName() == 'mysql' ? $this->conn->lastInsertId() : $id;
     $folder->setId($id);
     return $folder;
 }
Esempio n. 2
0
 /**
  * @see BackendAdapter::createFolder
  */
 public function createFolder(Folder $folder)
 {
     $document = $folder->toArray();
     $document['id'] = $this->createId();
     $this->create('folders', $document['id'], $document);
     $folder->setId($document['id']);
     return $folder;
 }
 /**
  * @see BackendAdapter::createFolder
  */
 public function createFolder(Folder $folder)
 {
     $folderEntity = new $this->folderEntityName();
     if ($folder->getParentId()) {
         $folderEntity->setParent($this->getFolderReference($folder->getParentId()));
     }
     $folderEntity->setName($folder->getName());
     $folderEntity->setUrl($folder->getUrl());
     $folderEntity->setUuid($folder->getUuid());
     $folderEntity->setData($folder->getData()->toArray());
     $this->em->persist($folderEntity);
     $this->em->flush($folderEntity);
     $folder->setId($folderEntity->getId());
     return $folder;
 }
Esempio n. 4
0
 /**
  * @see BackendAdapter::createFolder
  */
 public function createFolder(Folder $folder)
 {
     $document = $folder->toArray();
     $this->getMongo()->folders->insert($document);
     $this->getMongo()->folders->ensureIndex(array('name' => 1), array('unique' => true));
     $folder->setId($document['_id']->__toString());
     return $folder;
 }