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


PHP Zend_Db_Table_Abstract::find方法代码示例

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


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

示例1: find

 public function find($id)
 {
     $result = $this->dbTable->find($id);
     if (0 == count($result)) {
         return false;
     }
     $row = $result->current();
     return array('id' => $row->id, 'state' => $row->state, 'info' => $row->info, 'lastupdate' => $row->lastupdate, 'sticked' => $row->sticked);
 }
开发者ID:google-code-backups,项目名称:vlc-shares,代码行数:9,代码来源:Mapper.php

示例2: get

 public function get($_id)
 {
     $resultRet = $this->dbTable->find($_id);
     $enreg = $resultRet->current();
     if ($enreg === null) {
         return null;
     }
     $modelClassName = 'Application_Model_' . $this->className;
     $result = new $modelClassName();
     $result->fromArray($enreg);
     return $result;
 }
开发者ID:romainnext,项目名称:ZFTwitter,代码行数:12,代码来源:Abstract.php

示例3: deleteEntry

 /**
  * Delete Entry
  *
  * @param Postr_Model_Entry $entry
  * @return Postr_Model_EntryMapper          Provides a fluent interface
  */
 public function deleteEntry(Postr_Model_Entry $entry)
 {
     $dbAdapter = $this->_entryTable->getAdapter();
     $dbAdapter->beginTransaction();
     $entryRow = $this->_entryTable->find($entry->getId())->current();
     $entryRow->delete();
     $dbAdapter->commit();
     return $this;
 }
开发者ID:bradley-holt,项目名称:postr,代码行数:15,代码来源:EntryMapper.php

示例4: get

 /**
  * Returns the first row of the find query
  *
  * @param Integer|Array $primary
  * @return Zend_Db_Table_Row
  */
 public function get($pk)
 {
     // If the Primary Key is an Array
     if (is_array($pk)) {
         // Call the parent's find method with dynamic amount of parameters
         return call_user_func_array(array($this, 'find'), $pk)->current();
     }
     // The primary Key Is a single column
     return parent::find($pk)->current();
 }
开发者ID:nayanseth,项目名称:meetups,代码行数:16,代码来源:Table.php

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

示例6: find

 public function find($id)
 {
     $frontendOptions = array('lifetime' => 60 * 60 * 24, 'automatic_serialization' => true);
     $backendOptions = array('cache_dir' => APPLICATION_CACHE_PATH);
     $cache = Zend_Cache::factory('Core', 'File', $frontendOptions, $backendOptions);
     $row = null;
     if ($cache->test('role_' . $id)) {
         $row = $cache->load('role_' . $id);
     } else {
         $row = parent::find($id)->current();
         $cache->save($row, 'role_' . $row->id);
     }
     return $row;
 }
开发者ID:rogercastaneda,项目名称:owlsys,代码行数:14,代码来源:Role.php

示例7: find

 /**
  * Overwrite the find method to get relations too.
  *
  * @return Phprojekt_ActiveRecord_Abstract An instance of Phprojekt_ActiveRecord_Abstract.
  */
 public function find()
 {
     $args = func_get_args();
     if (1 > count($args)) {
         throw new Phprojekt_ActiveRecord_Exception('Missing argument');
     }
     if (1 < count($args)) {
         throw new Phprojekt_ActiveRecord_Exception('Too many arguments');
     }
     if (is_null($args[0])) {
         throw new Phprojekt_ActiveRecord_Exception('Argument cannot be NULL');
     }
     $find = parent::find($args[0]);
     if (false === is_array($find) || count($find) === 0) {
         return $find;
     }
     $find = $find[0];
     // Reset data as all our relatios, etc stuff has to
     // deal with a new id
     $this->_data = array();
     $this->_storedId = null;
     foreach ((array) $find->_data as $col => $value) {
         $this->_data[self::convertVarFromSql($col)] = $value;
     }
     unset($find);
     if (!array_key_exists('id', $this->_data)) {
         throw new Phprojekt_ActiveRecord_Exception('Table must have an id');
     }
     $this->_storedId = $this->_data['id'];
     $this->_originalData = $this->_data;
     return $this;
 }
开发者ID:RainyBlueSky,项目名称:PHProjekt,代码行数:37,代码来源:Abstract.php

示例8: find

 /**
  * 扩充了父类的同名方法,如果传入的是整形值或整数字符串,则取得主键值为该整形值的所有记录。
  * 
  * @param  mixed $key The value(s) of the primary keys.
  * @return ZtChart_Model_Db_Table_Rowset Row(s) matching the criteria.
  */
 public function find()
 {
     if (1 == func_num_args()) {
         $primary = func_get_arg(0);
         if ($this->_isInt($primary)) {
             return parent::find(intval($primary));
         }
     }
     return call_user_func_array(array('parent', 'find'), func_get_args());
 }
开发者ID:starflash,项目名称:ZtChart-ZF1-Example,代码行数:16,代码来源:Abstract.php


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