當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。