src/snac/server/database/SQL.php
/**
     * Search Resources
     *
     * @param string $query The string to search through the vocabulary
     * @param boolean $urlOnly optional Whether to only search the URL
     * @return string[][] Returns a list of lists.
     */
Search Resources
@param string $query The string to search through the vocabulary
@param boolean $urlOnly optional Whether to only search the URL
@return string[][] Returns a list of lists.
Search Resources @param string $query The string to search through the vocabulary @param boolean $urlOnly optional Whether to only search the URL @return string [] [] Returns a list of lists .
public function searchResources($query, $urlOnly = false)
    {
        $queryStr =
                  'select id, version, type, href, object_xml_wrap, title, extent, abstract, repo_ic_id, date, display_entry
                  from resource_cache
                  where href = $1 or title ilike $1 order by title asc';
        if ($urlOnly) {
            $queryStr =
                  'select id, version, type, href, object_xml_wrap, title, extent, abstract, repo_ic_id, date, display_entry
                  from resource_cache
                  where href = $1 order by title asc';
        }
        $result = $this->sdb->query($queryStr, array("%$query%"));
        $all = array();
        while($row = $this->sdb->fetchrow($result))
        {
            array_push($all, $row);
        }
        return $all;
    }
public function searchResources ( $ query , $ urlOnly = false ) { $ queryStr = 'select id, version, type, href, object_xml_wrap, title, extent, abstract, repo_ic_id, date, display_entry
                  from resource_cache
                  where href = $1 or title ilike $1 order by title asc' ; if ( $ urlOnly ) { $ queryStr = 'select id, version, type, href, object_xml_wrap, title, extent, abstract, repo_ic_id, date, display_entry
                  from resource_cache
                  where href = $1 order by title asc' ; } $ result = $ this -> sdb -> query ( $ queryStr , array ( " % $ query % " ) ) ; $ all = array ( ) ; while ( $ row = $ this -> sdb -> fetchrow ( $ result ) ) { array_push ( $ all , $ row ) ; } return $ all ; }
Search Resources
 @param string $query The string to search through the vocabulary
 @param boolean $urlOnly optional Whether to only search the URL
 @return string[][] Returns a list of lists.
Search Resources @param string $query The string to search through the vocabulary @param boolean $urlOnly optional Whether to only search the URL @return string [] [] Returns a list of lists .