LTreeExpression.class.php

Go to the documentation of this file.
00001 <?php
00002 /***************************************************************************
00003  *   Copyright (C) 2009 by Sergey S. Sergeev                               *
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     final class LTreeExpression extends StaticFactory
00019     {
00020         const ANCESTOR      = '@>';
00021         const DESCENDANT    = '<@';
00022         const MATCH         = '~';
00023         const SEARCH        = '@';
00024         
00030         public static function ancestor($left, $right)
00031         {
00032             return new BinaryExpression($left, $right, self::ANCESTOR);
00033         }
00034         
00040         public static function descendant($left, $right)
00041         {
00042             return new BinaryExpression($left, $right, self::DESCENDANT);
00043         }
00044         
00048         public static function match($ltree, $lquery)
00049         {
00050             return new BinaryExpression($ltree, $lquery, self::MATCH);
00051         }
00052         
00056         public static function search($ltree, $ltxtquery)
00057         {
00058             return new BinaryExpression($ltree, $ltxtquery, self::SEARCH);
00059         }
00060     }
00061 ?>