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


PHP ResultSet::current方法代码示例

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


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

示例1: getService

 /**
  * Get service
  *
  * @return string|boolean
  */
 public function getService()
 {
     $select = $this->select();
     $select->from('application_delete_content_service')->columns(['id', 'path'])->limit(1)->order('processed asc')->order('id asc');
     $statement = $this->prepareStatementForSqlObject($select);
     $resultSet = new ResultSet();
     $resultSet->initialize($statement->execute());
     if (!empty($resultSet->current())) {
         if (true === ($result = $this->markServiceProcessed($resultSet->current()['id']))) {
             return $resultSet->current()['path'];
         }
     }
     return false;
 }
开发者ID:esase,项目名称:dream-cms,代码行数:19,代码来源:ApplicationDeleteContent.php

示例2: getCommentsCount

 /**
  * Get comments count
  *
  * @param boolean $allowApprove
  * @param integer $pageId
  * @param string $pageSlug
  * @param integer $lastRightKey
  * @return integer
  */
 public function getCommentsCount($allowApprove, $pageId, $pageSlug = null, $lastRightKey = null)
 {
     $select = $this->select();
     $select->from('comment_list')->columns(['comments_count' => new Expression('COUNT(*)')])->where(['page_id' => $pageId, 'slug' => $pageSlug]);
     if (!$allowApprove) {
         $select->where(['hidden' => CommentNestedSet::COMMENT_STATUS_NOT_HIDDEN]);
     }
     if ($lastRightKey) {
         $select->where->lessThan($this->getCommentModel()->getRightKey(), $lastRightKey);
     }
     $statement = $this->prepareStatementForSqlObject($select);
     $resultSet = new ResultSet();
     $resultSet->initialize($statement->execute());
     return !empty($resultSet->current()->comments_count) ? $resultSet->current()->comments_count : 0;
 }
开发者ID:esase,项目名称:dream-cms-comment-module,代码行数:24,代码来源:CommentWidget.php

示例3: testCallingBufferAfterIterationThrowsException

 public function testCallingBufferAfterIterationThrowsException()
 {
     $this->resultSet->initialize($this->getMock('Zend\\Db\\Adapter\\Driver\\ResultInterface'));
     $this->resultSet->current();
     $this->setExpectedException('Zend\\Db\\ResultSet\\Exception\\RuntimeException', 'Buffering must be enabled before iteration is started');
     $this->resultSet->buffer();
 }
开发者ID:razvansividra,项目名称:pnlzf2-1,代码行数:7,代码来源:ResultSetIntegrationTest.php

示例4: checkActivationCode

 /**
  * Check activation code
  *
  * @param integer $userId
  * @param string $activationCode
  * @return boolean
  */
 public function checkActivationCode($userId, $activationCode)
 {
     $select = $this->select();
     $select->from('user_list')->columns(['user_id'])->where(['user_id' => $userId, 'activation_code' => $activationCode]);
     $statement = $this->prepareStatementForSqlObject($select);
     $resultSet = new ResultSet();
     $resultSet->initialize($statement->execute());
     return $resultSet->current() ? true : false;
 }
开发者ID:spooner77,项目名称:dream-cms,代码行数:16,代码来源:UserWidget.php

示例5: isAnswerVoteExist

 /**
  * Is answer vote exist
  *
  * @param integer $questionId
  * @return boolean
  */
 public function isAnswerVoteExist($questionId)
 {
     $remote = new RemoteAddress();
     $remote->setUseProxy(true);
     $select = $this->select();
     $select->from('poll_answer_track')->columns(['id'])->where(['question_id' => $questionId, 'ip' => inet_pton($remote->getIpAddress())]);
     $statement = $this->prepareStatementForSqlObject($select);
     $resultSet = new ResultSet();
     $resultSet->initialize($statement->execute());
     return !empty($resultSet->current());
 }
开发者ID:esase,项目名称:dream-cms-poll-module,代码行数:17,代码来源:PollWidget.php

示例6: isQuestionFree

 /**
  * Is question free
  *
  * @param string $question
  * @param integer $questionId
  * @return boolean
  */
 public function isQuestionFree($question, $questionId = 0)
 {
     $select = $this->select();
     $select->from('poll_question')->columns(['id'])->where(['question' => $question, 'language' => $this->getCurrentLanguage()]);
     if ($questionId) {
         $select->where([new NotInPredicate('id', [$questionId])]);
     }
     $statement = $this->prepareStatementForSqlObject($select);
     $resultSet = new ResultSet();
     $resultSet->initialize($statement->execute());
     return $resultSet->current() ? false : true;
 }
开发者ID:esase,项目名称:dream-cms-poll-module,代码行数:19,代码来源:PollBase.php

示例7: isRoleNameFree

 /**
  * Is a role's name free
  *
  * @param string $roleName
  * @param integer $roleId
  * @return boolean
  */
 public function isRoleNameFree($roleName, $roleId = 0)
 {
     $select = $this->select();
     $select->from('acl_role')->columns(['id'])->where(['name' => $roleName]);
     if ($roleId) {
         $select->where([new NotInPredicate('id', [$roleId])]);
     }
     $statement = $this->prepareStatementForSqlObject($select);
     $resultSet = new ResultSet();
     $resultSet->initialize($statement->execute());
     return $resultSet->current() ? false : true;
 }
开发者ID:spooner77,项目名称:dream-cms,代码行数:19,代码来源:AclAdministration.php

示例8: getProductJoinedRow

 /**
  * Get joined product
  * 
  * @param int $id product id
  * @return ProductJoinedRow
  * @throws Exception\InvalidArgumentException
  */
 public function getProductJoinedRow($id)
 {
     $id = (int) $id;
     $pt = $this->getJoinedTable('ProductTable')->getTable();
     $pdt = $this->getJoinedTable('ProductDescriptionTable')->getTable();
     $select = $this->sql->select()->from("{$pt}")->columns(array("*"))->join($pdt, "{$pt}.product_id = {$pdt}.product_id", array('description_id', 'description'), Select::JOIN_LEFT)->order("{$pt}.product_id DESC")->where("{$pt}.product_id = {$id}");
     $statement = $this->sql->prepareStatementForSqlObject($select);
     $resultSet = new ResultSet(ResultSet::TYPE_ARRAYOBJECT, new ProductJoinedRow());
     $resultSet->initialize($statement->execute());
     if (!$resultSet->count()) {
         throw new Exception\InvalidArgumentException("Not found joined product: {$id}");
     }
     return $resultSet->current();
 }
开发者ID:ashimidashajia,项目名称:zendstore,代码行数:21,代码来源:ProductJoinedTable.php

示例9: current

 /**
  * Iterator: get current item
  *
  * @throws Exception\LogicException whenever a record cannot be instanciated, due to missing column specs
  * @return Record
  */
 public function current()
 {
     $data = $this->dataSource->current();
     if (!$this->has_complete_record_definition) {
         $data_columns = array_keys($this->table->getColumnsInformation());
         $record_columns = array_keys((array) $data);
         $matches = array_intersect($data_columns, $record_columns);
         if (count($matches) != count($data_columns)) {
             $missings = join(',', array_diff($data_columns, $record_columns));
             $msg = __METHOD__ . ": Cannot create a Record due to incomplete or aliased column definition (missing: {$missings}).";
             $msg .= "Check whether columns have been modified in TableSearch::columns() method, or use an toArray(), toJson()... version of the ResultSet.";
             throw new Exception\LogicException($msg);
         }
         $this->has_complete_record_definition = true;
     }
     $record = $this->table->record($data, $ignore = true);
     $record->setState(Record::STATE_CLEAN);
     return $record;
 }
开发者ID:robocoder,项目名称:solublecomponents,代码行数:25,代码来源:ResultSet.php

示例10: get_last_periodic_transaction

 public function get_last_periodic_transaction(Item $item, $features)
 {
     $sql = $this->tableGateway->getSql();
     $select = $this->tableGateway->getSql()->select();
     $select->where($features);
     $select->order('accured_time DESC');
     $statement = $sql->prepareStatementForSqlObject($select);
     $results = $statement->execute();
     $rowset = new ResultSet();
     $rowset->initialize($results);
     $row = $rowset->current();
     if (!$row) {
         //			throw new \Exception("Could not find row $id");
     }
     return $row;
     //		$row = array();
     //		if (!empty($rowset))
     //			$row = $rowset[sizeof($rowset)-1];
     //		return $row;
 }
开发者ID:shadihrr,项目名称:daraii,代码行数:20,代码来源:TransactionTable.php

示例11: isValid

 public function isValid($username, $password)
 {
     $sql = $this->getObjDbSql();
     $select = $sql->select();
     $select->columns(array('u_kode', 'u_nama', 'u_kode_fungsional', 'u_gelar_diplomatik', 'u_urutan', 'u_password'));
     $select->from($this->table);
     $select->where(array("u_status=1", "u_nama = '{$username}' "));
     $statement = $sql->prepareStatementForSqlObject($select);
     $result = $statement->execute();
     $resultSet = new ResultSet();
     $resultSet->initialize($result);
     //return $resultSet->toArray();
     $user = $resultSet->current();
     if (!$user) {
         return false;
     }
     //
     if (md5($password) == $user['u_password']) {
         return $user;
     } else {
         return false;
     }
 }
开发者ID:vatoer,项目名称:EOfficeZf2,代码行数:23,代码来源:UserDbTable.php

示例12: isCategoryFree

 /**
  * Is a category free
  *
  * @param string $categoryName
  * @param integer $categoryId
  * @return boolean
  */
 public function isCategoryFree($categoryName, $categoryId = 0)
 {
     $select = $this->select();
     $select->from('miniphotogallery_category')->columns(['id'])->where(['name' => $categoryName, 'language' => $this->getCurrentLanguage()]);
     if ($categoryId) {
         $select->where([new NotInPredicate('id', [$categoryId])]);
     }
     $statement = $this->prepareStatementForSqlObject($select);
     $resultSet = new ResultSet();
     $resultSet->initialize($statement->execute());
     return $resultSet->current() ? false : true;
 }
开发者ID:esase,项目名称:dream-cms-mini-photo-gallery-module,代码行数:19,代码来源:MiniPhotoGalleryAdministration.php

示例13: fetchRow

 /**
  * Get one row of table for given $query
  *
  * @param \Zend\Db\Sql\Select $query
  * @param
  *            string | $prototypeClass
  * @return mixed
  */
 public function fetchRow(\Zend\Db\Sql\Select $query = null, $prototypeClass = null)
 {
     if (!$query) {
         $query = $this->getBaseQuery()->limit(1);
     }
     $stmt = $this->getSql()->prepareStatementForSqlObject($query);
     $res = $stmt->execute();
     $resultSet = new ResultSet();
     $arrayObjectPrototypeClass = $prototypeClass ? $prototypeClass : $this->arrayObjectPrototypeClass;
     $resultSet->setArrayObjectPrototype(new $arrayObjectPrototypeClass());
     $resultSet->initialize($res);
     return $resultSet->current();
 }
开发者ID:renatosalvatori,项目名称:visio-crud-zf2,代码行数:21,代码来源:AbstractTable.php

示例14: inShoppingCart

 /**
  * Check an item in shopping cart
  *
  * @param integer $objectId
  * @param integer $module
  * @return integer
  */
 public function inShoppingCart($objectId, $module)
 {
     $select = $this->select();
     $select->from('payment_shopping_cart')->columns(['id'])->where(['object_id' => $objectId, 'module' => $module, 'shopping_cart_id' => $this->getShoppingCartId(), 'language' => $this->getCurrentLanguage()]);
     $statement = $this->prepareStatementForSqlObject($select);
     $resultSet = new ResultSet();
     $resultSet->initialize($statement->execute());
     return $resultSet->current() ? $resultSet->current()->id : null;
 }
开发者ID:esase,项目名称:dream-cms-payment-module,代码行数:16,代码来源:PaymentWidget.php

示例15: isPageRated

 /**
  * Is page already rated
  *
  * @param integer $pageId
  * @param string $slug
  * @return boolean
  */
 public function isPageRated($pageId, $slug = null)
 {
     $remote = new RemoteAddress();
     $remote->setUseProxy(true);
     $visitorIp = inet_pton($remote->getIpAddress());
     $select = $this->select();
     $select->from(['a' => 'page_rating'])->columns(['id'])->join(['b' => 'page_rating_track'], new Expression('a.id = b.rating_id and b.ip = ?', [$visitorIp]), ['track_id' => 'id'], 'left')->where(['page_id' => $pageId, 'slug' => $slug]);
     $statement = $this->prepareStatementForSqlObject($select);
     $resultSet = new ResultSet();
     $resultSet->initialize($statement->execute());
     $data = $resultSet->current();
     if ($data && $data['track_id']) {
         return true;
     }
     return false;
 }
开发者ID:spooner77,项目名称:dream-cms,代码行数:23,代码来源:PageBase.php


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