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


PHP Zend_Db_Table_Abstract::select方法代码示例

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


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

示例1: 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

示例2: select

 public function select($withFromPart = self::SELECT_WITHOUT_FROM_PART)
 {
     $Select = parent::select($withFromPart);
     $Select->assemble();
     $Select->setIntegrityCheck(false);
     return $Select;
 }
开发者ID:BGCX262,项目名称:zweer-gdr-svn-to-git,代码行数:7,代码来源:Abstract.php

示例3: __construct

 /**
  * Creating a query using a Model.
  *
  * @param Zend_Db_Table_Abstract $model
  * @param array                  $relationmap Relation map for joins
  *
  * @return $this
  */
 public function __construct(Zend_Db_Table_Abstract $model, array $relationMap = array())
 {
     $this->_model = $model;
     $this->_relationMap = $relationMap;
     $info = $model->info();
     $select = $model->select();
     $map = $info['referenceMap'];
     $map = array_merge_recursive($map, $this->_relationMap);
     if (is_array($map) && count($map) > 0) {
         $select->setIntegrityCheck(false);
         $columnsToRemove = array();
         foreach ($map as $sel) {
             if (is_array($sel['columns'])) {
                 $columnsToRemove = array_merge($columnsToRemove, $sel['columns']);
             } else {
                 $columnsToRemove[] = $sel['columns'];
             }
         }
         $columnsMainTable = array_diff($info['cols'], $columnsToRemove);
         $select->from($info['name'], $columnsMainTable, $info['schema']);
         $tAlias = array($info['name'] => 1);
         $this->_setJoins($info['name'], $map, $select, $tAlias);
     } else {
         $select->from($info['name'], $info['cols'], $info['schema']);
     }
     parent::__construct($select);
     return $this;
 }
开发者ID:robjacoby,项目名称:xlr8u,代码行数:36,代码来源:Table.php

示例4: select

 public function select($withFromPart = self::SELECT_WITHOUT_FROM_PART)
 {
     $select = parent::select($withFromPart);
     if ($this->_multilang_type == 1 && $this->_current_lang) {
         $select->where('`lang` = ' . $this->_current_lang->id);
     }
     return $select;
 }
开发者ID:s-kalaus,项目名称:zkernel,代码行数:8,代码来源:Table.php

示例5: getSelect

 /**
  * Returns a \Zend_Db_Table_Select object to work with
  *
  * @return \Zend_Db_Table_Select
  */
 public function getSelect()
 {
     if ($this->hasItemsUsed()) {
         $select = $this->_table->select(\Zend_Db_Table_Abstract::SELECT_WITHOUT_FROM_PART);
         $select->from($this->_getTableName($this->_table), array());
         return $select;
     } else {
         return $this->_table->select(\Zend_Db_Table_Abstract::SELECT_WITH_FROM_PART);
     }
 }
开发者ID:GemsTracker,项目名称:MUtil,代码行数:15,代码来源:TableModel.php

示例6: getAttribute

 public function getAttribute($id)
 {
     if (isset($this->_attributes[$id])) {
         return $this->_attributes[$id];
     } elseif (is_numeric($id)) {
         $attribute = $this->_attributeModel->find($id)->current();
     } else {
         $where = $this->_attributeModel->select()->where($this->_attributeFieldName . ' = ?', $id);
         $attribute = $this->_attributeModel->fetchRow($where);
     }
     $this->cacheAttribute($attribute);
     return $attribute;
 }
开发者ID:laiello,项目名称:zend-framework-eav,代码行数:13,代码来源:Eav.php

示例7: _parseData

 /**
  * Get data from database table if avalid
  * @return array
  */
 protected function _parseData()
 {
     $data = $this->_data;
     if ($this->_adapter) {
         $select = $this->_adapter->select()->where("language=?", $this->_language);
         $stmt = $select->query();
         if ($stmt) {
             while ($row = $stmt->fetch()) {
                 $data[] = array(self::MESSAGE_ID_KEY => $row[self::MESSAGE_ID_KEY], self::MESSAGE_STRING_KEY => $this->replaceEndLineCharacter($row[self::MESSAGE_STRING_KEY]));
             }
             $stmt->closeCursor();
         }
         unset($select, $row, $stmt);
     }
     return $data;
 }
开发者ID:kangza,项目名称:hagtag,代码行数:20,代码来源:PoCreator.php

示例8: loadRow

	public function loadRow($value, $field = false) {
		$select = $this->table->select();
		//$this->table->getAdapter()->quote($v)
		// Check if value is an array
		if (is_array($value)) {
			foreach ($value as $k => $v) {
				$select->where("`$k` = ?", $v);
			}
		}
		else {
			if (!$field) {
				$field = $this->table->getPrimary();
			}
			$select->where("`$field` = ?", $value);
		}
		$this->row = $this->table->fetchRow($select);
	}
开发者ID:redokes,项目名称:Framework,代码行数:17,代码来源:Model.php

示例9: 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

示例10: testDbTableSelectDoesNotThrowException

 public function testDbTableSelectDoesNotThrowException()
 {
     $adapter = new Zend_Paginator_Adapter_DbSelect($this->_table->select());
     $count = $adapter->count();
     $this->assertEquals(500, $count);
 }
开发者ID:crodriguezn,项目名称:crossfit-milagro,代码行数:6,代码来源:DbSelectTest.php

示例11: select

 public function select($withFromPart = self::SELECT_WITHOUT_FROM_PART)
 {
     $select = parent::select($withFromPart);
     $select->where('removed = ?', false);
     return $select;
 }
开发者ID:laiello,项目名称:wanderson,代码行数:6,代码来源:People.php

示例12: indexOfEntries

 /**
  * Index Of Entries
  *
  * @return Zend_Paginator
  */
 public function indexOfEntries()
 {
     $entrySelect = $this->_entryTable->select();
     $paginator = new Zend_Paginator(new Postr_Model_EntryPaginatorAdapter($entrySelect, $this));
     return $paginator;
 }
开发者ID:bradley-holt,项目名称:postr,代码行数:11,代码来源:EntryMapper.php


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