Skip to content
Snippets Groups Projects
Commit 9401ab50 authored by Demian Katz's avatar Demian Katz
Browse files

Created interface to avoid dependence on AbstractQuery.

parent 6c53f7c6
No related merge requests found
...@@ -38,31 +38,6 @@ namespace VuFindSearch\Query; ...@@ -38,31 +38,6 @@ namespace VuFindSearch\Query;
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link http://vufind.org * @link http://vufind.org
*/ */
abstract class AbstractQuery abstract class AbstractQuery implements QueryInterface
{ {
/**
* Does the query contain the specified term?
*
* @param string $needle Term to check
*
* @return bool
*/
abstract public function containsTerm($needle);
/**
* Get a concatenated list of all query strings within the object.
*
* @return string
*/
abstract public function getAllTerms();
/**
* Replace a term.
*
* @param string $from Search term to find
* @param string $to Search term to insert
*
* @return void
*/
abstract public function replaceTerm($from, $to);
} }
\ No newline at end of file
<?php
/**
* Common methods that must be shared by all query objects.
*
* PHP version 5
*
* Copyright (C) Villanova University 2010.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @category VuFind2
* @package Search
* @author David Maus <maus@hab.de>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link http://vufind.org
*/
namespace VuFindSearch\Query;
/**
* Common methods that must be shared by all query objects.
*
* @category VuFind2
* @package Search
* @author David Maus <maus@hab.de>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link http://vufind.org
*/
interface QueryInterface
{
/**
* Does the query contain the specified term?
*
* @param string $needle Term to check
*
* @return bool
*/
public function containsTerm($needle);
/**
* Get a concatenated list of all query strings within the object.
*
* @return string
*/
public function getAllTerms();
/**
* Replace a term.
*
* @param string $from Search term to find
* @param string $to Search term to insert
*
* @return void
*/
public function replaceTerm($from, $to);
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment