ImaginaryDialect.class.php

Go to the documentation of this file.
00001 <?php
00002 /***************************************************************************
00003  *   Copyright (C) 2005-2007 by 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 /* $Id: ImaginaryDialect.class.php 4687 2007-12-09 18:57:18Z voxus $ */
00012 
00019     final class ImaginaryDialect extends Dialect
00020     {
00024         public static function me()
00025         {
00026             return Singleton::getInstance(__CLASS__);
00027         }
00028         
00029         public function preAutoincrement(DBColumn $column)
00030         {
00031             return null;
00032         }
00033         
00034         public function postAutoincrement(DBColumn $column)
00035         {
00036             return 'AUTOINCREMENT';
00037         }
00038         
00039         public static function quoteValue($value)
00040         {
00041             return $value;
00042         }
00043         
00044         public static function quoteField($field)
00045         {
00046             return $field;
00047         }
00048         
00049         public static function quoteTable($table)
00050         {
00051             return $table;
00052         }
00053         
00054         public function hasTruncate()
00055         {
00056             return false;
00057         }
00058         
00059         public function hasMultipleTruncate()
00060         {
00061             return false;
00062         }
00063 
00064         public function fieldToString($field)
00065         {
00066             return
00067                 $field instanceof DialectString
00068                     ? $field->toDialectString($this)
00069                     : $field;
00070         }
00071         
00072         public function valueToString($value)
00073         {
00074             return
00075                 $value instanceof DBValue
00076                     ? $value->toDialectString($this)
00077                     : $value;
00078         }
00079 
00080         public function fullTextSearch($field, $words, $logic)
00081         {
00082             return
00083                 '("'
00084                     .$this->fieldToString($field)
00085                     .'" CONTAINS "'
00086                     .implode($logic, $words)
00087                 .'")';
00088         }
00089         
00090         public function fullTextRank($field, $words, $logic)
00091         {
00092             return
00093                 '(RANK BY "'.$this->fieldToString($field).'" WHICH CONTAINS "'
00094                     .implode($logic, $words)
00095                 .'")';
00096         }
00097     }
00098 ?>

Generated on Sun Dec 9 21:56:23 2007 for onPHP by  doxygen 1.5.4