Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
limitable.php
Aller à la documentation de ce fichier.
1 <?php
2 /**
3  * @package Joomla.Platform
4  * @subpackage Database
5  *
6  * @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
7  * @license GNU General Public License version 2 or later; see LICENSE
8  */
9 
10 defined('JPATH_PLATFORM') or die;
11 
12 /**
13  * Joomla Database Query Limitable Interface.
14  * Adds bind/unbind methods as well as a getBounded() method
15  * to retrieve the stored bounded variables on demand prior to
16  * query execution.
17  *
18  * @package Joomla.Platform
19  * @subpackage Database
20  * @since 12.1
21  */
23 {
24  /**
25  * Method to modify a query already in string format with the needed
26  * additions to make the query limited to a particular number of
27  * results, or start at a particular offset. This method is used
28  * automatically by the __toString() method if it detects that the
29  * query implements the JDatabaseQueryLimitable interface.
30  *
31  * @param string $query The query in string format
32  * @param integer $limit The limit for the result set
33  * @param integer $offset The offset for the result set
34  *
35  * @return string
36  *
37  * @since 12.1
38  */
39  public function processLimit($query, $limit, $offset = 0);
40 
41  /**
42  * Sets the offset and limit for the result set, if the database driver supports it.
43  *
44  * Usage:
45  * $query->setLimit(100, 0); (retrieve 100 rows, starting at first record)
46  * $query->setLimit(50, 50); (retrieve 50 rows, starting at 50th record)
47  *
48  * @param integer $limit The limit for the result set
49  * @param integer $offset The offset for the result set
50  *
51  * @return JDatabaseQuery Returns this object to allow chaining.
52  *
53  * @since 12.1
54  */
55  public function setLimit($limit = 0, $offset = 0);
56 }