dbobjectiterator.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. // Copyright (C) 2010-2017 Combodo SARL
  3. //
  4. // This file is part of iTop.
  5. //
  6. // iTop is free software; you can redistribute it and/or modify
  7. // it under the terms of the GNU Affero General Public License as published by
  8. // the Free Software Foundation, either version 3 of the License, or
  9. // (at your option) any later version.
  10. //
  11. // iTop is distributed in the hope that it will be useful,
  12. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. // GNU Affero General Public License for more details.
  15. //
  16. // You should have received a copy of the GNU Affero General Public License
  17. // along with iTop. If not, see <http://www.gnu.org/licenses/>
  18. /**
  19. * A set of persistent objects, could be heterogeneous as long as the objects in the set have a common ancestor class
  20. *
  21. * @package iTopORM
  22. * @copyright Copyright (C) 2010-2017 Combodo SARL
  23. * @license http://opensource.org/licenses/AGPL-3.0
  24. */
  25. interface iDBObjectSetIterator extends Countable
  26. {
  27. /**
  28. * The class of the objects of the collection (at least a common ancestor)
  29. *
  30. * @return string
  31. */
  32. public function GetClass();
  33. /**
  34. * The total number of objects in the collection
  35. *
  36. * @return int
  37. */
  38. public function Count();
  39. /**
  40. * Reset the cursor to the first item in the collection. Equivalent to Seek(0)
  41. *
  42. * @return DBObject The fetched object or null when at the end
  43. */
  44. public function Rewind();
  45. /**
  46. * Position the cursor to the given 0-based position
  47. *
  48. * @param int $iRow
  49. */
  50. public function Seek($iPosition);
  51. /**
  52. * Fetch the object at the current position in the collection and move the cursor to the next position.
  53. *
  54. * @return DBObject The fetched object or null when at the end
  55. */
  56. public function Fetch();
  57. }