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


PHP Zend_Db_Table_Abstract::fetchAll方法代碼示例

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


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

示例1: fetchAll

 public function fetchAll()
 {
     $resultSet = $this->dbTable->fetchAll();
     $entries = array();
     foreach ($resultSet as $row) {
         $entries[] = array('id' => $row->id, 'state' => $row->state, 'info' => $row->info, 'lastupdate' => $row->lastupdate, 'sticked' => $row->sticked);
     }
     return $entries;
 }
開發者ID:google-code-backups,項目名稱:vlc-shares,代碼行數:9,代碼來源:Mapper.php

示例2: getAll

 public function getAll()
 {
     $resultSet = $this->dbTable->fetchAll();
     $resultTab = array();
     foreach ($resultSet as $enreg) {
         $modelClassName = 'Application_Model_' . $this->className;
         $result = new $modelClassName();
         $result->fromArray($enreg);
         $resultTab[] = $result;
     }
     return $resultTab;
 }
開發者ID:romainnext,項目名稱:ZFTwitter,代碼行數:12,代碼來源:Abstract.php

示例3: find

 /**
  * Find admin
  *
  * @param int $applicationId
  * @param string $username
  * @param Admin_Model_Admin $admin
  * @return boolean
  */
 public function find($applicationId, $username, Admin_Model_Admin $admin)
 {
     $select = $this->_dbTable->select();
     $select->setIntegrityCheck(false)->from(array('a' => 'admin'), array('a.*'))->joinLeft(array("aa" => "admin_application"), "aa.admin_id = a.id")->where('a.username = ?', $username)->where('aa.application_id = ?', $applicationId);
     $resultSet = $this->_dbTable->fetchAll($select);
     if (0 == count($resultSet)) {
         return false;
     }
     //get first row from resultSet
     $row = $resultSet->current();
     $admin->setOptions($row->toArray());
     return true;
 }
開發者ID:bokultis,項目名稱:kardiomedika,代碼行數:21,代碼來源:AdminMapper.php

示例4: isValid

 public function isValid($value)
 {
     $db = $this->_model->getAdapter();
     $where = $db->quoteInto($this->_field . ' = ?', $value);
     if (null !== $this->_where) {
         $where .= " AND {$this->_where}";
     }
     $rows = $this->_model->fetchAll($where);
     if (count($rows)) {
         $this->_messages[] = Axis::translate('core')->__("Record %s already exist", $value);
         return $this->_not;
     }
     $this->_messages[] = Axis::translate('core')->__("Record %s doesn't found", $value);
     return !$this->_not;
 }
開發者ID:baisoo,項目名稱:axiscommerce,代碼行數:15,代碼來源:Exists.php

示例5: _loadAcl

 /**
  * Load ACL rules from DB and load them in a Zend_Acl instance.
  *
  * @return Zend_Acl
  */
 protected function _loadAcl()
 {
     $this->_roles = $this->_roleTable->fetchAll();
     $this->_rules = $this->_ruleTable->fetchAll();
     $this->_resources = $this->_resourceTable->fetchAll();
     foreach ($this->_roles as $role) {
         $this->_loadRole($role);
     }
     foreach ($this->_resources as $resource) {
         $resourceID = null;
         $module = $resource->module;
         $controller = $resource->controller;
         if ($module != null && $controller != null) {
             $resourceID = $module . '.' . $controller;
         }
         if ($resourceID != null && !$this->has($resourceID)) {
             $this->add(new Zend_Acl_Resource($resourceID));
         }
     }
     foreach ($this->_rules as $rule) {
         $resourceID = null;
         $module = $rule->module;
         $controller = $rule->controller;
         if ($module != null && $controller != null) {
             $resourceID = $module . '.' . $controller;
         }
         if ((bool) $rule->allow) {
             $this->allow($rule->role, $resourceID, $rule->action);
         } else {
             $this->deny($rule->role, $resourceID, $rule->action);
         }
     }
     return $this;
 }
開發者ID:BGCX262,項目名稱:zym-svn-to-git,代碼行數:39,代碼來源:Db.php

示例6: fetchAll

 public function fetchAll($where = null, $order = null, $count = null, $offset = null)
 {
     $select = $this->getQueryAll();
     if ($where) {
         $select->where($where);
     }
     return parent::fetchAll($select);
 }
開發者ID:nandorodpires2,項目名稱:k-sys,代碼行數:8,代碼來源:Senha.php

示例7: loadData

 /**
  * Lazy load data via table fetchAll() method.
  *
  * @return void
  */
 protected function loadData()
 {
     if ($this->data === null) {
         $this->data = $this->_table->fetchAll($this->_where, $this->_order, $this->_count, $this->_offset);
         if ($this->data instanceof Zend_Db_Table_Rowset_Abstract) {
             $this->data = $this->data->toArray();
         }
     }
 }
開發者ID:basdog22,項目名稱:Qool,代碼行數:14,代碼來源:DbTable.php

示例8: fetchAll

 /**
  * This is overridden to handle cache
  * 
  * (non-PHPdoc)
  * @see library_Zend/Db/Table/Zend_Db_Table_Abstract#fetchAll($where, $order, $count, $offset)
  */
 public function fetchAll($where = null, $order = null, $count = null, $offset = null)
 {
     $name = $this->_name . '_' . md5($where);
     $data = $this->loadCache($name);
     if (!$data) {
         $data = parent::fetchAll($where, $order, $count, $offset);
         $this->saveCache($data, $name);
     }
     return $data;
 }
開發者ID:aprondak,項目名稱:ifphp,代碼行數:16,代碼來源:AbstractModel.php

示例9: getApplicationsByState

 /**
  * get enabled or disabled applications
  *
  * @param int $_state can be Tinebase_Application::ENABLED or Tinebase_Application::DISABLED
  * @return Tinebase_Record_RecordSet list of applications
  */
 public function getApplicationsByState($_status)
 {
     if ($_status !== Tinebase_Application::ENABLED && $_status !== Tinebase_Application::DISABLED) {
         throw new Tinebase_Exception_InvalidArgument('$_status can be only Tinebase_Application::ENABLED or Tinebase_Application::DISABLED');
     }
     $where[] = $this->_db->quoteInto($this->_db->quoteIdentifier('status') . ' = ?', $_status);
     $rowSet = $this->_applicationTable->fetchAll($where);
     $result = new Tinebase_Record_RecordSet('Tinebase_Model_Application', $rowSet->toArray(), TRUE);
     return $result;
 }
開發者ID:,項目名稱:,代碼行數:16,代碼來源:

示例10: fetchAll

 /**
  * wrapper around Zend_Db_Table_Abstract::fetchAll
  *
  * @param strin|array $_where OPTIONAL
  * @param string $_order OPTIONAL
  * @param string $_dir OPTIONAL
  * @param int $_count OPTIONAL
  * @param int $_offset OPTIONAL
  * @throws Tinebase_Exception_InvalidArgument if $_dir is not ASC or DESC
  * @return the row results per the Zend_Db_Adapter fetch mode.
  */
 public function fetchAll($_where = NULL, $_order = NULL, $_dir = 'ASC', $_count = NULL, $_offset = NULL)
 {
     if ($_dir != 'ASC' && $_dir != 'DESC') {
         throw new Tinebase_Exception_InvalidArgument('$_dir can be only ASC or DESC');
     }
     $order = NULL;
     if ($_order !== NULL) {
         $order = $_order . ' ' . $_dir;
     }
     $rowSet = parent::fetchAll($_where, $order, $_count, $_offset);
     return $rowSet;
 }
開發者ID:,項目名稱:,代碼行數:23,代碼來源:

示例11: fetchAll

 function fetchAll($where = null, $order = null, $count = null, $offset = null)
 {
     if (!is_object($where) || $where instanceof Zend_Db_Table_Select) {
         return parent::fetchAll($where, $order, $count, $offset);
     } else {
         if (!$where instanceof Zend_Db_Select) {
             throw new Exception("Mauvais type de requête");
         } else {
             throw new Exception("Qui sait traiter ça ? " . gettype($where));
         }
     }
 }
開發者ID:bersace,項目名稱:strass,代碼行數:12,代碼來源:Abstract.php

示例12: fetchAll

 /**
  * (non-PHPdoc)
  * @see Zend_Db_Table_Abstract::fetchAll()
  */
 public function fetchAll($where = null, $order = null, $count = null, $offset = null)
 {
     if (empty($where)) {
         $tableName = $this->getTableName();
         if (false == ($rows = App_Cache::load($tableName))) {
             $rows = parent::fetchAll($where, $order, $count, $offset);
             App_Cache::save($rows, $tableName);
         }
     } else {
         $rows = parent::fetchAll($where, $order, $count, $offset);
     }
     $rows = parent::fetchAll($where, $order, $count, $offset);
     return $rows;
 }
開發者ID:fredcido,項目名稱:simuweb,代碼行數:18,代碼來源:Abstract.php

示例13: fetchAll

 /**
  * wrapper around Zend_Db_Table_Abstract::fetchAll
  *
  * @param string|array $_where OPTIONAL
  * @param string $_order OPTIONAL
  * @param string $_dir OPTIONAL
  * @param int $_count OPTIONAL
  * @param int $_offset OPTIONAL
  * @throws Tinebase_Exception_InvalidArgument if $_dir is not ASC or DESC
  * @return array the row results per the Zend_Db_Adapter fetch mode.
  */
 public function fetchAll($_where = NULL, $_order = NULL, $_dir = 'ASC', $_count = NULL, $_offset = NULL)
 {
     if ($_dir != 'ASC' && $_dir != 'DESC') {
         throw new Tinebase_Exception_InvalidArgument('$_dir can be only ASC or DESC');
     }
     $order = NULL;
     if ($_order !== NULL) {
         $order = $_order . ' ' . $_dir;
     }
     // possibility to tracing queries
     if (Tinebase_Core::isLogLevel(Zend_Log::TRACE) && ($config = Tinebase_Core::getConfig()->logger)) {
         if ($config->traceQueryOrigins) {
             $e = new Exception();
             Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ . "\n" . "BACKTRACE: \n" . $e->getTraceAsString() . "\n" . "SQL QUERY: \n" . $this->select()->assemble());
         }
     }
     $rowSet = parent::fetchAll($_where, $order, $_count, $_offset);
     return $rowSet;
 }
開發者ID:ingoratsdorf,項目名稱:Tine-2.0-Open-Source-Groupware-and-CRM,代碼行數:30,代碼來源:Table.php

示例14: loadDestinationData

 /**
  * loadDestinationData
  * @author Thomas Schedler <tsh@massiveart.com>
  * @version 1.0 
  */
 private function loadDestinationData()
 {
     try {
         $objSelect = $this->objTable->select();
         $objSelect->setIntegrityCheck(false);
         $arrFields = array($this->strDBFLft, $this->strDBFRgt, $this->strDBFDepth);
         if (!is_null($this->strDBFParent)) {
             $arrFields[] = $this->strDBFParent;
         }
         if (!is_null($this->strDBFRoot)) {
             $arrFields[] = $this->strDBFRoot;
         }
         $objSelect->from($this->objTable->info(Zend_Db_Table_Abstract::NAME), $arrFields);
         $objSelect->where('id = ?', $this->intDestinationId);
         $this->objDestinationData = $this->objTable->fetchAll($objSelect);
     } catch (Exception $exc) {
         $this->core->logger->err($exc);
     }
 }
開發者ID:BGCX261,項目名稱:zoolu-svn-to-git,代碼行數:24,代碼來源:nested.set.class.php

示例15: fetchAll

 /** Fetch all data
  * @access public
  * @param array $where
  * @param string $order
  * @param string $count
  * @param integer $offset
  * @return array
  */
 public function fetchAll($where = null, $order = null, $count = null, $offset = null)
 {
     $id = md5($where->__toString());
     if (!$this->_cache->test($id) || !$this->cache_result) {
         $result = parent::fetchAll($where, $order, $count, $offset);
         $this->_cache->save($result);
         return $result;
     } else {
         return $this->_cache->load($id);
     }
 }
開發者ID:lesleyauk,項目名稱:findsorguk,代碼行數:19,代碼來源:Caching.php


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