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


PHP Publication::getGUID方法代码示例

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


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

示例1:

     $publication->title = $title;
     if (!$publication->save()) {
         // unable to save
         continue;
     }
 }
 if (!$publication instanceof Publication) {
     // something went wrong
     continue;
 }
 $publication->bibtext_reference = $ref;
 $publication->pubtype = $type;
 // set forwarding
 $count++;
 if ($forward_to_edit) {
     $forward_url = "publications/edit/{$publication->getGUID()}";
 } else {
     $forward_url = $publication->getURL();
 }
 // start handling some custom fields
 // start/end page
 $pages = $entry->getPages();
 if (is_array($pages)) {
     $publication->page_from = elgg_extract('0', $pages);
     $publication->page_to = elgg_extract('1', $pages);
 } else {
     $publication->page_from = $pages;
 }
 // authors
 $authors = $entry->getRawAuthors();
 if (!empty($authors)) {
开发者ID:Beaufort8,项目名称:elgg-publication,代码行数:31,代码来源:import.php

示例2: saveBookEditors

 /**
  * Save book editors with a publication
  *
  * @param string       $event  the name of the event
  * @param string       $type   the type of the event
  * @param \Publication $entity supplied entity
  *
  * @return void
  */
 public static function saveBookEditors($event, $type, $entity)
 {
     if (!$entity instanceof \Publication) {
         return;
     }
     // cleanup book editors
     $entity->deleteRelationships('book_editor');
     unset($entity->book_editors);
     $supported_types = ['book', 'inbook', 'incollection', 'proceedings', 'inproceedings'];
     $type = get_input('type');
     if (!in_array($type, $supported_types)) {
         return;
     }
     $book_editors_guids = get_input('book_editors');
     $book_editors_order = get_input('book_editors_order');
     // save book editors
     if (!empty($book_editors_guids)) {
         foreach ($book_editors_guids as $book_editor) {
             add_entity_relationship($entity->getGUID(), 'book_editor', $book_editor);
         }
     }
     $pbook_editors = implode(',', $book_editors_order);
     $entity->book_editors = $pbook_editors;
     $entity->save();
 }
开发者ID:Beaufort8,项目名称:elgg-publication,代码行数:34,代码来源:Types.php


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