當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Db_Adapter_Pdo_Mysql::fetchAssoc方法代碼示例

本文整理匯總了PHP中Zend_Db_Adapter_Pdo_Mysql::fetchAssoc方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Db_Adapter_Pdo_Mysql::fetchAssoc方法的具體用法?PHP Zend_Db_Adapter_Pdo_Mysql::fetchAssoc怎麽用?PHP Zend_Db_Adapter_Pdo_Mysql::fetchAssoc使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Db_Adapter_Pdo_Mysql的用法示例。


在下文中一共展示了Zend_Db_Adapter_Pdo_Mysql::fetchAssoc方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _detachSingleTag

 /**
  * detach a single tag from records
  * 
  * @param array $recordIds
  * @param string $dirtyTagId
  * @param string $appId
  * @param Tinebase_Controller_Record_Abstract $controller
  */
 protected function _detachSingleTag($recordIds, $dirtyTagId, $appId, $controller)
 {
     $tag = $this->getTagsById($dirtyTagId, Tinebase_Model_TagRight::USE_RIGHT)->getFirstRecord();
     if (empty($tag)) {
         Tinebase_Core::getLogger()->notice(__METHOD__ . '::' . __LINE__ . ' No use right for tag, detaching not possible.');
         return;
     }
     $tagId = $tag->getId();
     $attachedIds = array();
     $select = $this->_db->select()->from(array('tagging' => SQL_TABLE_PREFIX . 'tagging'), 'record_id')->where($this->_db->quoteIdentifier('application_id') . ' = ?', $appId)->where($this->_db->quoteIdentifier('tag_id') . ' = ? ', $tagId)->where($this->_db->quoteInto($this->_db->quoteIdentifier('record_id') . ' IN (?)', $recordIds));
     Tinebase_Backend_Sql_Abstract::traitGroup($select);
     foreach ($this->_db->fetchAssoc($select) as $tagArray) {
         $attachedIds[] = $tagArray['record_id'];
     }
     if (empty($attachedIds)) {
         Tinebase_Core::getLogger()->notice(__METHOD__ . '::' . __LINE__ . ' There are no records we could detach the tag(s) from');
         return;
     }
     Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__ . ' Detaching 1 Tag from ' . count($attachedIds) . ' records.');
     foreach ($attachedIds as $recordId) {
         $this->_db->delete(SQL_TABLE_PREFIX . 'tagging', array($this->_db->quoteIdentifier('tag_id') . ' = ?' => $tagId, $this->_db->quoteIdentifier('record_id') . ' = ?' => $recordId, $this->_db->quoteIdentifier('application_id') . ' = ?' => $appId));
     }
     $controller->concurrencyManagementAndModlogMultiple($attachedIds, array('tags' => array($tag->toArray())), array('tags' => array()));
     $this->_deleteOccurrence($tagId, count($attachedIds));
 }
開發者ID:bitExpert,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:33,代碼來源:Tags.php

示例2: searchCount

 /**
  * Returns roles count
  * 
  * @param Tinebase_Model_RoleFilter $_filter
  * @return int
  */
 public function searchCount($_filter)
 {
     $select = $_filter->getSelect();
     $roles = new Tinebase_Record_RecordSet('Tinebase_Model_Role', $this->_db->fetchAssoc($select));
     return count($roles);
 }
開發者ID:rodrigofns,項目名稱:ExpressoLivre3,代碼行數:12,代碼來源:Roles.php


注:本文中的Zend_Db_Adapter_Pdo_Mysql::fetchAssoc方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。