FullText.class.php

Go to the documentation of this file.
00001 <?php
00002 /****************************************************************************
00003  *   Copyright (C) 2005-2008 by Anton E. Lebedevich, Konstantin V. Arkhipov *
00004  *                                                                          *
00005  *   This program is free software; you can redistribute it and/or modify   *
00006  *   it under the terms of the GNU Lesser General Public License as         *
00007  *   published by the Free Software Foundation; either version 3 of the     *
00008  *   License, or (at your option) any later version.                        *
00009  *                                                                          *
00010  ****************************************************************************/
00011 
00018     abstract class FullText
00019         implements DialectString, MappableObject, LogicalObject
00020     {
00021         protected $logic = null;
00022         protected $field = null;
00023         protected $words = null;
00024         
00025         public function __construct($field, $words, $logic)
00026         {
00027             if (is_string($field))
00028                 $field = new DBField($field);
00029             
00030             Assert::isArray($words);
00031             
00032             $this->field = $field;
00033             $this->words = $words;
00034             $this->logic = $logic;
00035         }
00036         
00040         public function toMapped(ProtoDAO $dao, JoinCapableQuery $query)
00041         {
00042             return new $this(
00043                 $dao->guessAtom($this->field, $query, $dao->getTable()),
00044                 $this->words,
00045                 $this->logic
00046             );
00047         }
00048         
00049         public function toBoolean(Form $form)
00050         {
00051             throw new UnsupportedMethodException();
00052         }
00053     }
00054 ?>