Source for file RootAssetSearch.class.php

Documentation is available at RootAssetSearch.class.php

  1. <?php
  2. /**
  3. * @package harmoni.osid_v2.repository.search
  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: RootAssetSearch.class.php,v 1.6 2007/09/04 20:25:47 adamfranco Exp $
  9. */
  10.  
  11. require_once(dirname(__FILE__)."/SearchModule.interface.php");
  12.  
  13. /**
  14. * Return assets of the specified type
  15. *
  16. *
  17. * @package harmoni.osid_v2.repository.search
  18. *
  19. * @copyright Copyright &copy; 2005, Middlebury College
  20. * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
  21. *
  22. * @version $Id: RootAssetSearch.class.php,v 1.6 2007/09/04 20:25:47 adamfranco Exp $
  23. */
  24.  
  25. class RootAssetSearch
  26. extends SearchModuleInterface {
  27. /**
  28. * Constructor
  29. *
  30. * @param object $dr
  31. * @return object
  32. * @access public
  33. * @since 11/2/04
  34. */
  35. function RootAssetSearch ( $dr ) {
  36. $this->_dr =$dr;
  37. }
  38. /**
  39. * Get the ids of the assets that match the search criteria
  40. *
  41. * @param mixed $searchCriteria
  42. * @return array
  43. * @access public
  44. * @since 11/2/04
  45. */
  46. function searchAssets ( $searchCriteria ) {
  47. // get the root Nodes
  48. $rootNodes =$this->_dr->_node->getChildren();
  49. // Add the ids of the root nodes to an array
  50. $rootIds = array();
  51. while ($rootNodes->hasNext()) {
  52. $rootNode =$rootNodes->next();
  53. $rootIds[] =$rootNode->getId();
  54. }
  55. // Return the array
  56. return $rootIds;
  57. }
  58. }
  59.  
  60. ?>

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