protected function changeTreeIdsToPaths(&$ungrupedStatements, $uploadTreeTableName, $uploadId)
 {
     $parentId = $this->treeDao->getMinimalCoveringItem($uploadId, $uploadTreeTableName);
     foreach ($ungrupedStatements as &$statement) {
         $uploadTreeId = $statement['uploadtree_pk'];
         unset($statement['uploadtree_pk']);
         if (!array_key_exists($uploadTreeId, $this->fileNameCache)) {
             $this->fileNameCache[$uploadTreeId] = $this->treeDao->getFullPath($uploadTreeId, $uploadTreeTableName, $parentId);
         }
         $statement['fileName'] = $this->fileNameCache[$uploadTreeId];
     }
     unset($statement);
 }
Esempio n. 2
0
 public function testGetFullPathWithComlpexStructureFromFileAndOtherUpload()
 {
     $this->prepareUploadTree($this->getTestFileStructure());
     $this->prepareModularTable(array(array(6, 5, 1, 0, 0, 5, 6, "file", 6)));
     $cover = $this->treeDao->getMinimalCoveringItem(32, "uploadtree");
     assertThat($cover, equalTo(3652));
     assertThat($this->treeDao->getFullPath(3665, "uploadtree", $cover), equalTo("L/L2/L2a"));
     assertThat($this->treeDao->getFullPath(3665, "uploadtree"), equalTo("uploadDaoTest.tar/uploadDaoTest/L/L2/L2a"));
 }