当前位置: 首页>>代码示例>>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;未经允许,请勿转载。