Source for file FromNodesAssetIterator.class.php

Documentation is available at FromNodesAssetIterator.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: FromNodesAssetIterator.class.php,v 1.3 2007/09/04 20:25:43 adamfranco Exp $
  9. */
  10.  
  11. require_once(dirname(__FILE__)."/HarmoniAssetIterator.class.php");
  12.  
  13. /**
  14. * The FromNodesAsset iterator lazily fetches assets as they are requested.
  15. *
  16. * <p>
  17. * OSID Version: 2.0
  18. * </p>
  19. *
  20. *
  21. *
  22. * @package harmoni.osid_v2.repository
  23. *
  24. * @copyright Copyright &copy;2005, Middlebury College
  25. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
  26. *
  27. * @version $Id: FromNodesAssetIterator.class.php,v 1.3 2007/09/04 20:25:43 adamfranco Exp $
  28. */
  29. class FromNodesAssetIterator
  30. extends HarmoniAssetIterator
  31. //implements AssetIterator
  32.  
  33. {
  34. /**
  35. * Constructor
  36. *
  37. * @param object NodeIterator $nodes
  38. * @param object Repository $repository
  39. * @return object
  40. * @access public
  41. * @since 5/4/06
  42. */
  43. function FromNodesAssetIterator ( $nodes, $repository ) {
  44. // ArgumentValidator::validate($nodes, ExtendsValidatorRule::getRule("Iterator"));
  45. ArgumentValidator::validate($repository, ExtendsValidatorRule::getRule("Repository"));
  46. $this->_nodes =$nodes;
  47. $this->_repository =$repository;
  48. }
  49. /**
  50. * Return true if there is an additional Asset ; false otherwise.
  51. *
  52. * @return boolean
  53. *
  54. * @throws object RepositoryException An exception with one of
  55. * the following messages defined in
  56. * org.osid.repository.RepositoryException may be thrown: {@link }
  57. * org.osid.repository.RepositoryException#OPERATION_FAILED
  58. * OPERATION_FAILED}, {@link }
  59. * org.osid.repository.RepositoryException#PERMISSION_DENIED
  60. * PERMISSION_DENIED}, {@link }
  61. * org.osid.repository.RepositoryException#CONFIGURATION_ERROR
  62. * CONFIGURATION_ERROR}, {@link }
  63. * org.osid.repository.RepositoryException#UNIMPLEMENTED
  64. * UNIMPLEMENTED}
  65. *
  66. * @access public
  67. */
  68. function hasNext () {
  69. return $this->_nodes->hasNext();
  70. }
  71. /**
  72. * Return the next Asset.
  73. *
  74. * @return object Asset
  75. *
  76. * @throws object HierarchyException An exception with one of
  77. * the following messages defined in
  78. * org.osid.hierarchy.HierarchyException may be thrown: {@link }
  79. * org.osid.hierarchy.HierarchyException#OPERATION_FAILED
  80. * OPERATION_FAILED}, {@link }
  81. * org.osid.hierarchy.HierarchyException#PERMISSION_DENIED
  82. * PERMISSION_DENIED}, {@link }
  83. * org.osid.hierarchy.HierarchyException#CONFIGURATION_ERROR
  84. * CONFIGURATION_ERROR}, {@link }
  85. * org.osid.hierarchy.HierarchyException#UNIMPLEMENTED
  86. * UNIMPLEMENTED}, {@link }
  87. * org.osid.hierarchy.HierarchyException#NO_MORE_ITERATOR_ELEMENTS
  88. * NO_MORE_ITERATOR_ELEMENTS}
  89. *
  90. * @access public
  91. */
  92. function next () {
  93. $child =$this->_nodes->next();
  94. return $this->_repository->getAsset($child->getId());
  95. }
  96.  
  97. }
  98.  
  99. ?>

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