/**
  * Rename a file
  * @param object $from path_parts
  * @param object $to path_parts
  * @return boolean.  True if copy is ok, False otherwise.
  */
 public function rename($from, $to)
 {
     $fileid = $this->get_file_id($from);
     $bra5ServiceGet = new Bra5ServiceGet();
     $bra5ServiceGet->getDocument(new Bra5StructGetDocument($this->secKey, $fileid));
     $document = $bra5ServiceGet->getResult()->getGetDocumentResult();
     foreach ($document->Attributes as &$Attribute) {
         if ($Attribute->getName() == 'Tittel') {
             $Attribute->setValue(array($to->fake_name_clean));
         }
     }
     $bra5ServiceUpdate = new Bra5ServiceUpdate();
     $ok = false;
     if (!($ok = $bra5ServiceUpdate->updateDocument(new Bra5StructUpdateDocument($this->secKey, $document)))) {
         _debug_array($bra5ServiceUpdate->getResult());
     }
     return $ok;
 }
예제 #2
0
    print_r($bra5ServiceSearch->getLastError());
}
/*******************************
 * Example for Bra5ServiceCreate
 */
$bra5ServiceCreate = new Bra5ServiceCreate();
// sample call for Bra5ServiceCreate::createDocument()
if ($bra5ServiceCreate->createDocument(new Bra5StructCreateDocument())) {
    print_r($bra5ServiceCreate->getResult());
} else {
    print_r($bra5ServiceCreate->getLastError());
}
/*******************************
 * Example for Bra5ServiceUpdate
 */
$bra5ServiceUpdate = new Bra5ServiceUpdate();
// sample call for Bra5ServiceUpdate::updateDocument()
if ($bra5ServiceUpdate->updateDocument(new Bra5StructUpdateDocument())) {
    print_r($bra5ServiceUpdate->getResult());
} else {
    print_r($bra5ServiceUpdate->getLastError());
}
// sample call for Bra5ServiceUpdate::updateAttribute()
if ($bra5ServiceUpdate->updateAttribute(new Bra5StructUpdateAttribute())) {
    print_r($bra5ServiceUpdate->getResult());
} else {
    print_r($bra5ServiceUpdate->getLastError());
}
/*******************************
 * Example for Bra5ServiceDelete
 */