Source for file HarmoniAssetIterator.class.php

Documentation is available at HarmoniAssetIterator.class.php

  1. <?php
  2. /**
  3. * @package harmoni.osid_v2.repository
  4. *
  5. * @copyright Copyright &copy; 2005, Middlebury College
  6. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  7. *
  8. * @version $Id: HarmoniAssetIterator.class.php,v 1.14 2007/09/04 20:25:43 adamfranco Exp $
  9. */
  10.  
  11. //require_once(OKI2."osid/repository/AssetIterator.interface.php");
  12. require_once(HARMONI."oki2/shared/HarmoniIterator.class.php");
  13.  
  14. /**
  15. * AssetIterator provides access to these objects sequentially, one at a time.
  16. * The purpose of all Iterators is to to offer a way for OSID methods to
  17. * return multiple values of a common type and not use an array. Returning an
  18. * array may not be appropriate if the number of values returned is large or
  19. * is fetched remotely. Iterators do not allow access to values by index,
  20. * rather you must access values in sequence. Similarly, there is no way to go
  21. * backwards through the sequence unless you place the values in a data
  22. * structure, such as an array, that allows for access by index.
  23. *
  24. * <p>
  25. * OSID Version: 2.0
  26. * </p>
  27. *
  28. *
  29. *
  30. * @package harmoni.osid_v2.repository
  31. *
  32. * @copyright Copyright &copy;2005, Middlebury College
  33. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
  34. *
  35. * @version $Id: HarmoniAssetIterator.class.php,v 1.14 2007/09/04 20:25:43 adamfranco Exp $
  36. */
  37. class HarmoniAssetIterator
  38. extends HarmoniIterator
  39. //implements AssetIterator
  40.  
  41. {
  42. /**
  43. * Return true if there is an additional Asset ; false otherwise.
  44. *
  45. * @return boolean
  46. *
  47. * @throws object RepositoryException An exception with one of
  48. * the following messages defined in
  49. * org.osid.repository.RepositoryException may be thrown: {@link }
  50. * org.osid.repository.RepositoryException#OPERATION_FAILED
  51. * OPERATION_FAILED}, {@link }
  52. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  53. * PERMISSION_DENIED}, {@link }
  54. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  55. * CONFIGURATION_ERROR}, {@link }
  56. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  57. * UNIMPLEMENTED}
  58. *
  59. * @access public
  60. */
  61. function hasNextAsset () {
  62. return $this->hasNext();
  63. }
  64.  
  65. /**
  66. * Return the next Asset.
  67. *
  68. * @return object Asset
  69. *
  70. * @throws object RepositoryException An exception with one of
  71. * the following messages defined in
  72. * org.osid.repository.RepositoryException may be thrown: {@link }
  73. * org.osid.repository.RepositoryException#OPERATION_FAILED
  74. * OPERATION_FAILED}, {@link }
  75. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  76. * PERMISSION_DENIED}, {@link }
  77. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  78. * CONFIGURATION_ERROR}, {@link }
  79. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  80. * UNIMPLEMENTED}, {@link }
  81. * org.osid.repository.RepositoryException#NO_MORE_ITERATOR_ELEMENTS
  82. * NO_MORE_ITERATOR_ELEMENTS}
  83. *
  84. * @access public
  85. */
  86. function nextAsset () {
  87. return $this->next();
  88. }
  89. /**
  90. * Return the next Asset.
  91. *
  92. * @return object Asset
  93. *
  94. * @throws object HierarchyException An exception with one of
  95. * the following messages defined in
  96. * org.osid.hierarchy.HierarchyException may be thrown: {@link }
  97. * org.osid.hierarchy.HierarchyException#OPERATION_FAILED
  98. * OPERATION_FAILED}, {@link }
  99. * org.osid.hierarchy.HierarchyException#PERMISSION_DENIED
  100. * PERMISSION_DENIED}, {@link }
  101. * org.osid.hierarchy.HierarchyException#CONFIGURATION_ERROR
  102. * CONFIGURATION_ERROR}, {@link }
  103. * org.osid.hierarchy.HierarchyException#UNIMPLEMENTED
  104. * UNIMPLEMENTED}, {@link }
  105. * org.osid.hierarchy.HierarchyException#NO_MORE_ITERATOR_ELEMENTS
  106. * NO_MORE_ITERATOR_ELEMENTS}
  107. *
  108. * @access public
  109. */
  110. function next () {
  111. // If this is the first element access, inform our AZ cache that we are
  112. // working with this set of nodes so that it can fetch AZs for all of
  113. // them at once.
  114. if ($this->_i == -1) {
  115. $isAuthorizedCache = IsAuthorizedCache::instance();
  116. $isAuthorizedCache->queueAssetArray($this->_elements);
  117. }
  118. return parent::next();
  119. }
  120.  
  121. }
  122.  
  123. ?>

Documentation generated on Wed, 19 Sep 2007 10:23:43 -0400 by phpDocumentor 1.3.0RC3