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


PHP Document::getId方法代码示例

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


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

示例1: getDependencyForFrontend

 /**
  * @param Document|Asset|Object_Abstract $element
  * @return array
  */
 public static function getDependencyForFrontend($element)
 {
     if ($element instanceof Document) {
         return array("id" => $element->getId(), "path" => $element->getFullPath(), "type" => "document", "subtype" => $element->getType());
     } else {
         if ($element instanceof Asset) {
             return array("id" => $element->getId(), "path" => $element->getFullPath(), "type" => "asset", "subtype" => $element->getType());
         } else {
             if ($element instanceof Object_Abstract) {
                 return array("id" => $element->getId(), "path" => $element->getFullPath(), "type" => "object", "subtype" => $element->geto_Type());
             }
         }
     }
 }
开发者ID:ngocanh,项目名称:pimcore,代码行数:18,代码来源:Service.php

示例2: copyRecursive

 /**
  * @param  Document $target
  * @param  Document $source
  * @return Document copied document
  */
 public function copyRecursive($target, $source)
 {
     // avoid recursion
     if (!$this->_copyRecursiveIds) {
         $this->_copyRecursiveIds = array();
     }
     if (in_array($source->getId(), $this->_copyRecursiveIds)) {
         return;
     }
     if ($source instanceof Document_Page || $source instanceof Document_Snippet) {
         $source->getElements();
     }
     $source->getProperties();
     $new = clone $source;
     $new->id = null;
     $new->setChilds(null);
     $new->setKey(Element_Service::getSaveCopyName("document", $new->getKey(), $target));
     $new->setParentId($target->getId());
     $new->setUserOwner($this->_user->getId());
     $new->setUserModification($this->_user->getId());
     $new->setResource(null);
     $new->setLocked(false);
     $new->save();
     // add to store
     $this->_copyRecursiveIds[] = $new->getId();
     foreach ($source->getChilds() as $child) {
         $this->copyRecursive($new, $child);
     }
     $this->updateChilds($target, $new);
     return $new;
 }
开发者ID:ngocanh,项目名称:pimcore,代码行数:36,代码来源:Service.php

示例3: testSetGetId

 public function testSetGetId()
 {
     $document = new Document($this->mandango);
     $this->assertNull($document->getId());
     $id = new \MongoId('123');
     $this->assertSame($document, $document->setId($id));
     $this->assertSame($id, $document->getId());
 }
开发者ID:gtunes,项目名称:mandango,代码行数:8,代码来源:DocumentTest.php

示例4: export

 public static function export(Document $document)
 {
     $json = db::query('SELECT creation_date, data FROM snapshots WHERE document = ' . db::value($document->getId()) . ' ORDER BY creation_date DESC');
     foreach ($json as $i => $row) {
         $json[$i]['data'] = json_decode($row['data']);
     }
     return $json;
 }
开发者ID:roadlabs,项目名称:diagraph,代码行数:8,代码来源:snapshot.php

示例5: testSetGetId

 public function testSetGetId()
 {
     $document = new Document($this->mongator);
     $this->assertNull($document->getId());
     $id = new \MongoId('4af9f23d8ead0e1d32000000');
     $this->assertSame($document, $document->setId($id));
     $this->assertSame($id, $document->getId());
 }
开发者ID:mongator,项目名称:mongator,代码行数:8,代码来源:DocumentTest.php

示例6: newWordsAction

 public function newWordsAction($data = array())
 {
     $req = new Request();
     $doc = -1;
     $doc = new Document(-1);
     $data = array('docId' => $doc->getId(), 'docWords' => $doc->getWords(), 'prevWords' => '');
     return json_encode($data);
 }
开发者ID:jhdees,项目名称:jhdeescom,代码行数:8,代码来源:DocController.php

示例7: testSetGetId

 public function testSetGetId()
 {
     $document = new Document($this->mandango);
     $this->assertNull($document->getId());
     $id = new \MongoDB\BSON\ObjectID($this->generateObjectId());
     $this->assertSame($document, $document->setId($id));
     $this->assertSame($id, $document->getId());
 }
开发者ID:netom,项目名称:mandango,代码行数:8,代码来源:DocumentTest.php

示例8: saveAttachment

 public function saveAttachment(Document $document, $attachment)
 {
     $attachment_parts = pathinfo($attachment);
     $basename = $attachment_parts['basename'];
     $finfo = finfo_open(FILEINFO_MIME_TYPE);
     $contentType = finfo_file($finfo, $attachment);
     $id = $document->getId();
     if (empty($id)) {
         $document->setId($document->getFields()['_id']);
     }
     $uri = sprintf('%s/%s/%s?rev=%s', $this->client->getDatabase(), $document->getId(), $basename, $document->getRevision());
     try {
         $response = $this->parseResponse($this->curl->put($this->client->getPath($uri), file_get_contents($attachment), $contentType));
     } catch (\Exception $e) {
         return $e->getMessage();
     }
     return $response;
 }
开发者ID:paulomartinhago,项目名称:php-couchdb,代码行数:18,代码来源:Service.php

示例9: enrich

 /**
  * 
  * @return boolean
  */
 public function enrich()
 {
     $this->checkValuesQuery();
     foreach ($this->properties as $xpath => $prop) {
         self::$valuesQuery->execute(array($this->document->getId(), $xpath, $this->tokenId));
         while ($value = self::$valuesQuery->fetch(\PDO::FETCH_OBJ)) {
             $user = $this->createTeiFeature('user', $value->user_id);
             $date = $this->createTeiFeature('date', $value->date);
             $xpath = $this->createTeiFeature('property_xpath', $xpath);
             $val = $this->createTeiFeature('value', $value->value);
             $fs = $this->createTeiFeatureSet();
             $fs->appendChild($user);
             $fs->appendChild($date);
             $fs->appendChild($xpath);
             $fs->appendChild($val);
             if ($prop->nodeType !== XML_ELEMENT_NODE) {
                 $prop->parentNode->appendChild($fs);
             } else {
                 $prop->appendChild($fs);
             }
         }
     }
     return $this->updateDocument();
 }
开发者ID:acdh-oeaw,项目名称:tokeneditor,代码行数:28,代码来源:Token.php

示例10: getByPath

 /**
  * Static helper to get a Document by it's path, only type Document is returned, not Document_Page, ... (see getConcreteByPath() )
  *
  * @param string $path
  * @return Document
  */
 public static function getByPath($path)
 {
     $path = Element_Service::correctPath($path);
     try {
         $document = new Document();
         // validate path
         if (Pimcore_Tool::isValidPath($path)) {
             $document->getResource()->getByPath($path);
         }
         return self::getById($document->getId());
     } catch (Exception $e) {
         Logger::warning($e);
     }
     return null;
 }
开发者ID:nblackman,项目名称:pimcore,代码行数:21,代码来源:Document.php

示例11: assert

 /**
  * This is the constructor for the KTAPI_Document
  *
  * @author KnowledgeTree Team
  * @access private
  * @param KTAPI $ktapi The KTAPI object
  * @param KTAPI_Folder $ktapi_folder The parent folder object
  * @param Document $document The internal document object
  * @return KTAPI_Document
  */
 function KTAPI_Document(&$ktapi, &$ktapi_folder, &$document)
 {
     assert($ktapi instanceof KTAPI);
     //is_a($ktapi,'KTAPI'));
     assert(is_null($ktapi_folder) || $ktapi_folder instanceof KTAPI_Folder);
     //is_a($ktapi_folder,'KTAPI_Folder'));
     $this->ktapi =& $ktapi;
     $this->ktapi_folder =& $ktapi_folder;
     $this->document =& $document;
     $this->documentid = $document->getId();
 }
开发者ID:sfsergey,项目名称:knowledgetree,代码行数:21,代码来源:KTAPIDocument.inc.php

示例12: addInstanceToPool

 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param Document $obj A Document object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool($obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         DocumentPeer::$instances[$key] = $obj;
     }
 }
开发者ID:rapila,项目名称:cms-base,代码行数:22,代码来源:BaseDocumentPeer.php

示例13: setDocument

 /**
  * Declares an association between this object and a Document object.
  *
  * @param                  Document $v
  * @return DocumentationPart The current object (for fluent API support)
  * @throws PropelException
  */
 public function setDocument(Document $v = null)
 {
     if ($v === null) {
         $this->setImageId(NULL);
     } else {
         $this->setImageId($v->getId());
     }
     $this->aDocument = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the Document object, it will not be re-added.
     if ($v !== null) {
         $v->addDocumentationPart($this);
     }
     return $this;
 }
开发者ID:rapila,项目名称:plugin-documentation,代码行数:22,代码来源:BaseDocumentationPart.php

示例14: allowDocumentRelation

 /**
  *
  * Checks if an document is an allowed relation
  * @param Document $document
  * @return boolean
  */
 protected function allowDocumentRelation($document)
 {
     $allowedDocumentTypes = $this->getDocumentTypes();
     $allowed = true;
     if (!$this->getDocumentsAllowed()) {
         $allowed = false;
     } else {
         if ($this->getDocumentsAllowed() and is_array($allowedDocumentTypes) and count($allowedDocumentTypes) > 0) {
             //check for allowed asset types
             foreach ($allowedDocumentTypes as $t) {
                 $allowedTypes[] = $t['documentTypes'];
             }
             if (!in_array($document->getType(), $allowedTypes)) {
                 $allowed = false;
             }
         } else {
             //don't check if no allowed document types set
         }
     }
     \Logger::debug("checked object relation to target document [" . $document->getId() . "] in field [" . $this->getName() . "], allowed:" . $allowed);
     return $allowed;
 }
开发者ID:rolandstoll,项目名称:pimcore,代码行数:28,代码来源:AbstractRelations.php

示例15: removeDocument

 /**
  * Удаляет документ из БД
  * @global \TDataBase $DB
  * @param \Document $doc
  */
 static function removeDocument(&$doc)
 {
     global $DB;
     $sql = 'DELETE FROM ' . TRUSTED_DB_TABLE_DOCUMENTS . '  ' . 'WHERE ID = ' . $doc->getId();
     $DB->Query($sql);
     TDataBaseDocument::saveDocumentParent($doc);
 }
开发者ID:Digt,项目名称:trusted-php,代码行数:12,代码来源:document.php


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