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


PHP Zotero_DB::columnQueryFromStatement方法代码示例

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


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

示例1: loadRelatedItems

 private function loadRelatedItems()
 {
     if (!$this->id) {
         return;
     }
     Z_Core::debug("Loading related items for item {$this->id}");
     if ($this->loaded['relatedItems']) {
         trigger_error("Related items for item {$this->id} already loaded", E_USER_ERROR);
     }
     if (!$this->loaded['primaryData']) {
         $this->loadPrimaryData(true);
     }
     // TODO: use a prepared statement
     if (!is_numeric($this->id)) {
         trigger_error("Invalid itemID '{$this->id}'", E_USER_ERROR);
     }
     $cacheKey = $this->getCacheKey("itemRelated");
     //$ids = Z_Core::$MC->get($cacheKey);
     $ids = false;
     if ($ids === false) {
         $sql = "SELECT linkedItemID FROM itemRelated WHERE itemID=?";
         $stmt = Zotero_DB::getStatement($sql, true, Zotero_Shards::getByLibraryID($this->libraryID));
         $ids = Zotero_DB::columnQueryFromStatement($stmt, $this->id);
         Z_Core::$MC->set($cacheKey, $ids ? $ids : array());
     }
     $this->relatedItems = $ids ? $ids : array();
     $this->loaded['relatedItems'] = true;
 }
开发者ID:robinpaulson,项目名称:dataserver,代码行数:28,代码来源:Item.inc.php

示例2: getUsedFields

	/**
	 * Returns all fields used in item
	 *
	 * @param	bool		$asNames		Return as field names
	 * @return	array				Array of field ids or names
	 */
	public function getUsedFields($asNames=false) {
		if (!$this->id) {
			return array();
		}
		
		$sql = "SELECT fieldID FROM itemData WHERE itemID=?";
		$stmt = Zotero_DB::getStatement($sql, true, Zotero_Shards::getByLibraryID($this->libraryID));
		$fields = Zotero_DB::columnQueryFromStatement($stmt, $this->id);
		if (!$fields) {
			$fields = array();
		}
		
		if ($asNames) {
			$fieldNames = array();
			foreach ($fields as $field) {
				$fieldNames[] = Zotero_ItemFields::getName($field);
			}
			$fields = $fieldNames;
		}
		
		return $fields;
	}
开发者ID:kskod,项目名称:dataserver,代码行数:28,代码来源:Item.inc.php

示例3: loadLinkedItems

 private function loadLinkedItems()
 {
     Z_Core::debug("Loading linked items for tag {$this->id}");
     if (!$this->id && !$this->key) {
         $this->linkedItemsLoaded = true;
         return;
     }
     if (!$this->loaded) {
         $this->load();
     }
     if (!$this->id) {
         $this->linkedItemsLoaded = true;
         return;
     }
     $sql = "SELECT itemID FROM itemTags WHERE tagID=?";
     $stmt = Zotero_DB::getStatement($sql, true, Zotero_Shards::getByLibraryID($this->libraryID));
     $ids = Zotero_DB::columnQueryFromStatement($stmt, $this->id);
     $this->linkedItems = array();
     if ($ids) {
         $this->linkedItems = Zotero_Items::get($this->libraryID, $ids);
     }
     $this->linkedItemsLoaded = true;
 }
开发者ID:robinpaulson,项目名称:dataserver,代码行数:23,代码来源:Tag.inc.php


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