• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

Services/Search/classes/Like/class.ilLikeMetaDataSearch.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00035 include_once 'Services/Search/classes/class.ilMetaDataSearch.php';
00036 
00037 class ilLikeMetaDataSearch extends ilMetaDataSearch
00038 {
00039 
00044         function ilLikeMetaDataSearch(&$qp_obj)
00045         {
00046                 parent::ilMetaDataSearch($qp_obj);
00047         }
00048 
00049         // Private
00050         function __createKeywordWhereCondition()
00051         {
00052                 $concat = ' keyword ';
00053                 $where = " WHERE ";
00054                 $counter = 0;
00055                 foreach($this->query_parser->getQuotedWords() as $word)
00056                 {
00057                         if($counter++)
00058                         {
00059                                 $where .= "OR";
00060                         }
00061                         $where .= $concat;
00062                         $where .= (" LIKE ('%".$word."%')");
00063                 }
00064                 return $where;
00065         }               
00066 
00067         function __createContributeWhereCondition()
00068         {
00069                 $concat = ' entity ';
00070                 $where = " WHERE ";
00071                 $counter = 0;
00072                 foreach($this->query_parser->getQuotedWords() as $word)
00073                 {
00074                         if($counter++)
00075                         {
00076                                 $where .= "OR";
00077                         }
00078                         $where .= $concat;
00079                         $where .= (" LIKE ('%".$word."%')");
00080                 }
00081                 return $where;
00082         }               
00083         function __createTitleWhereCondition()
00084         {
00085                 $concat = ' CONCAT(title,coverage) ';
00086                 $where = " WHERE ";
00087                 $counter = 0;
00088                 foreach($this->query_parser->getQuotedWords() as $word)
00089                 {
00090                         if($counter++)
00091                         {
00092                                 $where .= "OR";
00093                         }
00094                         $where .= $concat;
00095                         $where .= (" LIKE ('%".$word."%')");
00096                 }
00097                 return $where;
00098         }
00099 
00100         function __createDescriptionWhereCondition()
00101         {
00102                 $concat = ' description ';
00103                 $where = " WHERE ";
00104                 $counter = 0;
00105                 foreach($this->query_parser->getQuotedWords() as $word)
00106                 {
00107                         if($counter++)
00108                         {
00109                                 $where .= "OR";
00110                         }
00111                         $where .= $concat;
00112                         $where .= (" LIKE ('%".$word."%')");
00113                 }
00114                 return $where;
00115         }
00116 }
00117 ?>

Generated on Fri Dec 13 2013 10:18:31 for ILIAS Release_3_5_x_branch .rev 46805 by  doxygen 1.7.1