# Source for file Offset.php

Documentation is available at Offset.php

1. <?php
2. /*
3. * $Id: Offset.php 1080 2007-02-10 18:17:08Z romanb $
4. *
5. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
6. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
7. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
8. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
9. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
10. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
11. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
12. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
13. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
14. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
15. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16. *
17. * This software consists of voluntary contributions made by many individuals
18. * and is licensed under the LGPL. For more information, see
19. * <http://www.phpdoctrine.com>.
20. */
21. Doctrine::autoload('Doctrine_Collection_Offset');
22. /**
23. * Doctrine_Collection_Offset
24. * Collection of Doctrine_Record objects.
25. *
26. * @package Doctrine
27. * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
28. * @category Object Relational Mapping
29. * @link www.phpdoctrine.com
30. * @since 1.0
31. * @version $Revision: 1080 $
32. * @author Konsta Vesterinen <kvesteri@cc.hut.fi>
33. */
34. class Doctrine_Collection_Offset extends Doctrine_Collection
35. {
36. /**
37. * @var integer $limit
38. */
39. private $limit;
40. /**
41. * @param Doctrine_Table $table
42. */
43. public function __construct(Doctrine_Table $table)
44. {
45. parent::__construct($table);
46. $this->limit = $table->getAttribute(Doctrine::ATTR_COLL_LIMIT);
47. }
48. /**
49. * @return integer
50. */
51. public function getLimit()
52. {
53. return $this->limit;
54. }
55. /**
56. * @return Doctrine_Collection_Iterator_Expandable
57. */
58. public function getIterator()
59. {
60. return new Doctrine_Collection_Iterator_Expandable($this);
61. }
62. }