Documentation is available at DescriptionSearch.class.php
- <?php
- /**
- * @package harmoni.osid_v2.repository.search
- *
- * @copyright Copyright © 2005, Middlebury College
- * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
- *
- * @version $Id: DescriptionSearch.class.php,v 1.10 2007/09/04 20:25:47 adamfranco Exp $
- */
- require_once(dirname(__FILE__)."/RegexSearch.abstract.php");
- /**
- * Return assets of the specified type
- *
- *
- * @package harmoni.osid_v2.repository.search
- *
- * @copyright Copyright © 2005, Middlebury College
- * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License (GPL)
- *
- * @version $Id: DescriptionSearch.class.php,v 1.10 2007/09/04 20:25:47 adamfranco Exp $
- */
- class DescriptionSearch
- extends RegexSearch
- {
- /**
- * Constructor
- *
- * @param object $dr
- * @return object
- * @access public
- * @since 11/2/04
- */
- function DescriptionSearch ( $dr ) {
- $this->_dr =$dr;
- }
- /**
- * Get the ids of the assets that match the search criteria
- *
- * @param mixed $searchCriteria
- * @return array
- * @access public
- * @since 11/2/04
- */
- function searchAssets ( $searchCriteria ) {
- $searchCriteria = $this->translateToRegex($searchCriteria);
- $matchingIds = array();
- // Get All the assets
- $assets =$this->_dr->getAssets();
- // Add their id to the array if the displayName matches
- while ($assets->hasNext()) {
- $asset =$assets->next();
- if (preg_match($searchCriteria, $asset->getDescription()))
- $matchingIds[] =$asset->getId();
- }
- // Return the array
- return $matchingIds;
- }
- }
- ?>
Documentation generated on Wed, 19 Sep 2007 10:22:43 -0400 by phpDocumentor 1.3.0RC3