当前位置: 首页>>代码示例>>PHP>>正文


PHP Document::setName方法代码示例

本文整理汇总了PHP中Document::setName方法的典型用法代码示例。如果您正苦于以下问题:PHP Document::setName方法的具体用法?PHP Document::setName怎么用?PHP Document::setName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Document的用法示例。


在下文中一共展示了Document::setName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: sendForBilling

 function sendForBilling()
 {
     $response = new Response();
     try {
         $projectId = $this->input->post("project-id");
         $amount = $this->input->post("project-bill-amount");
         $billDoc = $this->input->post("bill-doc");
         $project = $this->findById("Project", $projectId);
         if ($project == null) {
             throw new RuntimeException("Invalid Project..!");
         }
         $project->setStatus(Project::PROJECT_BILL);
         $project->getWorkOrder()->setStatus(Workorder::STATUS_COMPLETED);
         $project->getWorkOrder()->setApprovedBy($this->getLoggedInUser());
         $bill = new Bill();
         $bill->setAmount($amount);
         $bill->setProject($project);
         $bill->setCreated(new DateTime());
         $bill->setStatus(Bill::STATUS_PENDING);
         if ($billDoc != null && $billDoc != "") {
             foreach ($billDoc as $file) {
                 $doc = new Document();
                 $doc->setName($file);
                 $doc->setCreated(new DateTime());
                 $bill->getBillDoc()->add($doc);
             }
         }
         $this->save($bill);
         $response->setData(Project::PROJECT_BILL);
     } catch (Exception $e) {
         $response->setStatus(false);
         $response->setErrorMessage($e->getMessage());
     }
     $this->output->set_content_type('application/json')->set_output(json_encode($response));
 }
开发者ID:digvijaymohite,项目名称:e-tender,代码行数:35,代码来源:Workorders.php

示例2: getDocument

 /**
  * @param  string   $suffix
  * @return Document
  */
 protected function getDocument($suffix = '')
 {
     $document = new Document();
     $document->setName('Test name ' . $suffix);
     $document->setDescription('Test description ' . $suffix);
     $document->setRank(11);
     $document->setRating(93.31);
     return $document;
 }
开发者ID:bcncommerce,项目名称:serializer,代码行数:13,代码来源:TestCase.php

示例3: createUser

 /**
  * @param string $username
  * @param string $password
  * @param array $roles
  * @throws InvalidArgumentException
  */
 public function createUser($username, $password, $roles = array())
 {
     if (strlen($username) < 1 || strlen($password) < 1) {
         throw new InvalidArgumentException("Details can't be empty");
     }
     $document = new Document();
     $document->setName($username)->setType('user')->setRoles($roles)->setPassword((string) $password);
     $url = $this->getServerUrl() . "/_users/org.couchdb.user:{$username}";
     $this->client->put($url, 201, $this->getOptions(), $document);
 }
开发者ID:superpanda19,项目名称:CouchDBAdapter,代码行数:16,代码来源:AdminServer.php

示例4: parseDocument

 /**
  * This method parses the given document and extract its fingerprints
  * encapsulating the result in a Document object.
  *
  * @private
  * @param $documentName the name given by the user to the file
  * @param $documentPath the temporary path that the document is being stored
  * @return {Document}
  */
 private function parseDocument($documentName, $documentPath)
 {
     $pdfParser = new \Smalot\PdfParser\Parser();
     $parsedPDF = $pdfParser->parseFile($documentPath);
     $text = $parsedPDF->getText();
     $fingerprints = $this->documentService->extractFingerprint($text);
     $doc = new Document();
     $doc->setName($documentName);
     //preg_replace('/[^a-zA-Z0-9]/', '', $text)
     $doc->setContent($text);
     $doc->setFingerprints($fingerprints);
     return $doc;
 }
开发者ID:nplott,项目名称:surpreenda-me,代码行数:22,代码来源:PDFDocumentController.php

示例5: createDocument

 /**
  * Создает новый Документ. При создании нового Документа добавляется запись в БД.
  * @param string $file Путь к файлу
  * @param boolean $copy Если значение параметра Истина, то файл будет скопирован в папку модуля trustednetsiger
  * @param string $name Пользовательское имя файла
  * @param string $type Тип файла. По умолчанию DOCUMENT_TYPE_DOCUMENT
  * @return \Document
  */
 public static function createDocument($file, $copy, $name = null, $type = DOCUMENT_TYPE_FILE)
 {
     $sysName = CDirectory::getFileName($file);
     echo $sysName . PHP_EOL;
     if ($copy && CDirectory::exists($file) && !is_dir($file)) {
         print_r("Copy file" . PHP_EOL);
         print_r(TRUSDET_SIGN_DOCS_ROOT . PHP_EOL);
         if (!CDirectory::exists(TRUSDET_SIGN_DOCS_ROOT)) {
             print_r("Create folder" . PHP_EOL);
             CDirectory::create(TRUSDET_SIGN_DOCS_ROOT);
         }
         $new_path = TRUSDET_SIGN_DOCS_ROOT . '/' . $sysName;
         copy($file, $new_path);
         //unlink($file);
         $file = $new_path;
     }
     $name = $name ? $name : $sysName;
     $doc = new Document();
     $doc->setPath(str_replace($sysName, urlencode($sysName), $file));
     $doc->setName($name);
     $doc->setSysName($sysName);
     $doc->setType($type);
     // $doc->getProperties()->add(new Property($doc->getId(), "STATUS", "NONE"));
     // $props = $doc->getProperties();
     // $props->add(new Property(null, "ORDER", $orderId));
     print_r($doc);
     $doc->save();
     return $doc;
 }
开发者ID:Digt,项目名称:trusted-php,代码行数:37,代码来源:custom.php

示例6: copy

 /**
  * 
  * @return \Document
  */
 public function copy()
 {
     $new = new Document();
     $new->setName($this->getName());
     $new->setPath($this->getPath());
     $new->setSigners($this->getSigners());
     $new->setSysName($this->getSysName());
     $new->setType($this->getType());
     $list = $this->getProperties()->getList();
     foreach ($list as &$prop) {
         $newProp = new Property(null, $prop->getType(), $prop->getValue());
         $new->getProperties()->add($newProp);
     }
     return $new;
 }
开发者ID:Digt,项目名称:trusted-php,代码行数:19,代码来源:document.php

示例7: addDocument

 public function addDocument($name, $file)
 {
     $document = new Document($this->addSubElement("document"));
     $document->setId($this->getId() . "_document_" . $this->getNewDocumentId());
     $document->setName($name);
     $document->setFile($file);
     $this->saveDOM();
     return $document;
 }
开发者ID:jacomyma,项目名称:GEXF-Atlas,代码行数:9,代码来源:engine.php

示例8: approveTechnicalSanction

 function approveTechnicalSanction()
 {
     $response = new Response();
     try {
         $projectId = $this->input->post("approve-project-id");
         $approvedAmt = $this->input->post("project-sanction-amount");
         $attachment = $this->input->post("approve-doc");
         $project = $this->findById("Project", $projectId);
         if ($project == null) {
             throw new RuntimeException("Invalid Project..!");
         }
         $project->setStatus(Project::PROJECT_TENDER);
         $techSanction = new TechnicalSanction();
         $techSanction->setProject($project);
         $techSanction->setCreated(new DateTime());
         $techSanction->setSanctionedAmount($approvedAmt);
         $techSanction->setApprovedBy($this->getLoggedInUser());
         if ($attachment != null && $attachment != "") {
             foreach ($attachment as $file) {
                 $doc = new Document();
                 $doc->setName($file);
                 $doc->setCreated(new DateTime());
                 $techSanction->getSanctionDoc()->add($doc);
             }
         }
         $this->save($techSanction);
     } catch (Exception $e) {
         $response->setStatus(false);
         $response->setErrorMessage($e->getMessage());
     }
     $this->output->set_content_type('application/json')->set_output(json_encode($response));
 }
开发者ID:digvijaymohite,项目名称:e-tender,代码行数:32,代码来源:Projects.php


注:本文中的Document::setName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。