PageRenderTime 14ms CodeModel.GetById 7ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/libraries/joomla/database/iterator/sqlsrv.php

https://gitlab.com/vitaliylukin91/text
PHP | 55 lines | 17 code | 4 blank | 34 comment | 0 complexity | be6dec09a4ef82c2463fd291a64d098a MD5 | raw file
 1<?php
 2/**
 3 * @package     Joomla.Platform
 4 * @subpackage  Database
 5 *
 6 * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
 7 * @license     GNU General Public License version 2 or later; see LICENSE
 8 */
 9
10defined('JPATH_PLATFORM') or die;
11
12/**
13 * SQL server database iterator.
14 *
15 * @since  12.1
16 */
17class JDatabaseIteratorSqlsrv extends JDatabaseIterator
18{
19	/**
20	 * Get the number of rows in the result set for the executed SQL given by the cursor.
21	 *
22	 * @return  integer  The number of rows in the result set.
23	 *
24	 * @since   12.1
25	 * @see     Countable::count()
26	 */
27	public function count()
28	{
29		return sqlsrv_num_rows($this->cursor);
30	}
31
32	/**
33	 * Method to fetch a row from the result set cursor as an object.
34	 *
35	 * @return  mixed   Either the next row from the result set or false if there are no more rows.
36	 *
37	 * @since   12.1
38	 */
39	protected function fetchObject()
40	{
41		return sqlsrv_fetch_object($this->cursor, $this->class);
42	}
43
44	/**
45	 * Method to free up the memory used for the result set.
46	 *
47	 * @return  void
48	 *
49	 * @since   12.1
50	 */
51	protected function freeResult()
52	{
53		sqlsrv_free_stmt($this->cursor);
54	}
55}