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


PHP SugarFolder::getCountUnread方法代码示例

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


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

示例1: getCountNewItems

 /**
  * Returns the number of "new" items (based on passed criteria)
  * @param string id ID of folder
  * @param array criteria
  * 		expected:
  * 		array('field' => 'status',
  * 				'value' => 'unread');
  * @param array
  * @return int
  */
 function getCountNewItems($id, $criteria, $folder)
 {
     global $current_user;
     $sugarFolder = new SugarFolder();
     return $sugarFolder->getCountUnread($id);
     /*
     $sugarFolder = new SugarFolder();
     return $sugarFolder->getCountUnread($id);
     /*
     $count = 0;
     
     // if dynamic query is for "My Drafts" run special count logic.
     if(!empty($folder['dynamic_query'])) {
     	$folder['dynamic_query'] = from_html($folder['dynamic_query']);
     	if(strpos($folder['dynamic_query'], "type = 'draft'") !== false) {
     		$q = "SELECT COUNT(*) c " . substr($folder['dynamic_query'], strpos($folder['dynamic_query'], "FROM"));
     		$r = $this->db->query($q);
     		$a = $this->db->fetchByAssoc($r);
     		$count = $a['c'];
     	}
     }
     
     $q = "SELECT polymorphic_module, polymorphic_id FROM folders_rel fr JOIN folders f ON fr.folder_id = f.id WHERE f.id = '{$id}'";
     $r = $this->db->query($q);
     $ins = ""; // IN () scope clause
     
     while($a = $this->db->fetchByAssoc($r)) {
     	$table = strtolower($a['polymorphic_module']);
     
     	if(!empty($ins)) {
     		$ins .= ", ";
     	}
     
     	$ins .= "'{$a['polymorphic_id']}'";
     }
     
     if(isset($table)) {
     	$qC = "SELECT count(*) c FROM {$table} WHERE deleted = 0 AND id IN ({$ins}) AND {$criteria['field']} = '{$criteria['value']}'";
     	$rC = $this->db->query($qC);
     	$aC = $this->db->fetchByAssoc($rC);
     
     	return ($count + $aC['c']);
     }
     
     return $count;;
     */
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:57,代码来源:SugarFolders.php

示例2: getCountNewItems

 /**
  * Returns the number of "new" items (based on passed criteria)
  * @param string id ID of folder
  * @param array criteria
  * 		expected:
  * 		array('field' => 'status',
  * 				'value' => 'unread');
  * @param array
  * @return int
  */
 function getCountNewItems($id, $criteria, $folder)
 {
     global $current_user;
     $sugarFolder = new SugarFolder();
     return $sugarFolder->getCountUnread($id);
 }
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:16,代码来源:SugarFolders.php


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