Arabic
[ class tree: Arabic ] [ index: Arabic ] [ all elements ]

Class: ArQuery

Source Location: /sub/ArQuery.class.php

Class Overview


This PHP class build WHERE condition for SQL statement using MySQL REGEXP and Arabic lexical rules


Author(s):

Copyright:

  • 2009 Khaled Al-Shamaa

Variables

Methods



Class Details

[line 187]
This PHP class build WHERE condition for SQL statement using MySQL REGEXP and Arabic lexical rules



Tags:

author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
copyright:  2009 Khaled Al-Shamaa
link:  http://www.ar-php.org
license:  LGPL


[ Top ]


Class Variables

$_fields = array()

[line 189]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


method allForms [line 686]

string allForms( string $arg, [string $inputCharset = null], [string $outputCharset = null], [object $main = null])

Get most possible Arabic lexical forms of user search keywords



Tags:

return:  list of most possible Arabic lexical forms for given keywords
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  public


Parameters:

string   $arg   String that user search for
string   $inputCharset   (optional) Input charset [utf-8|windows-1256|iso-8859-6] default value is NULL (use set input charset)
string   $outputCharset   (optional) Output charset [utf-8|windows-1256|iso-8859-6] default value is NULL (use set output charset)
object   $main   Main Ar-PHP object to access charset converter options

[ Top ]

method getArrFields [line 283]

array getArrFields( )

Getting values of $fields Array in array format



Tags:

return:  Value of $fields array in Array format
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  public


[ Top ]

method getMode [line 271]

integer getMode( )

Getting $mode propority value that refer to search mode [0 for OR logic | 1 for AND logic]



Tags:

return:  Value of $mode properity
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  public


[ Top ]

method getOrderBy [line 426]

string getOrderBy( string $arg, [string $inputCharset = null], [string $outputCharset = null], [object $main = null])

Get more relevant order by section related to the user search keywords



Tags:

return:  sub SQL ORDER BY section
author:  Saleh AlMatrafe <saleh@saleh.cc>
access:  public


Parameters:

string   $arg   String that user search for in the database table
string   $inputCharset   (optional) Input charset [utf-8|windows-1256|iso-8859-6] default value is NULL (use set input charset)
string   $outputCharset   (optional) Output charset [utf-8|windows-1256|iso-8859-6] default value is NULL (use set output charset)
object   $main   Main Ar-PHP object to access charset converter options

[ Top ]

method getStrFields [line 296]

string getStrFields( )

Getting values of $fields array in String format (comma delimated)



Tags:

return:  Values of $fields array in String format (comma delimated)
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  public


[ Top ]

method getWhereCondition [line 318]

string getWhereCondition( string $arg, [string $inputCharset = null], [string $outputCharset = null], [object $main = null])

Build WHERE section of the SQL statement using defind lex's rules, search mode [AND | OR], and handle also phrases (inclosed by "") using normal LIKE condition to match it as it is.



Tags:

return:  The WHERE section in SQL statement (MySQL database engine format)
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  public


Parameters:

string   $arg   String that user search for in the database table
string   $inputCharset   (optional) Input charset [utf-8|windows-1256|iso-8859-6] default value is NULL (use set input charset)
string   $outputCharset   (optional) Output charset [utf-8|windows-1256|iso-8859-6] default value is NULL (use set output charset)
object   $main   Main Ar-PHP object to access charset converter options

[ Top ]

method setArrFields [line 200]

boolean setArrFields( array $arrConfig)

Setting value for $fields array



Tags:

return:  TRUE if success, or FALSE if fail
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  public


Parameters:

array   $arrConfig   Name of the fields that SQL statement will search them (in array format where items are those fields names)

[ Top ]

method setMode [line 250]

boolean setMode( integer $mode)

Setting $mode propority value that refer to search mode [0 for OR logic | 1 for AND logic]



Tags:

return:  TRUE if success, or FALSE if fail
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  public


Parameters:

integer   $mode   Setting value to be saved in the $mode propority

[ Top ]

method setStrFields [line 228]

boolean setStrFields( string $strConfig)

Setting value for $fields array



Tags:

return:  TRUE if success, or FALSE if fail
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  public


Parameters:

string   $strConfig   Name of the fields that SQL statement will search them (in string format using comma as delimated)

[ Top ]

method _allWordForms [line 586]

string _allWordForms( string $word)

Get most possible Arabic lexical forms for a given word



Tags:

return:  list of most possible Arabic lexical forms for a given word
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  protected


Parameters:

string   $word   String that user search for

[ Top ]

method _getWordLike [line 406]

string _getWordLike( string $arg)

Search condition in SQL format for one word in all defind fields using normal LIKE clause



Tags:

return:  sub SQL condition (for private use)
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  protected


Parameters:

string   $arg   String (one word) that you want to build a condition for

[ Top ]

method _getWordRegExp [line 387]

string _getWordRegExp( string $arg)

Search condition in SQL format for one word in all defind fields using REGEXP clause and lex's rules



Tags:

return:  sub SQL condition (for private use)
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  protected


Parameters:

string   $arg   String (one word) that you want to build a condition for

[ Top ]

method _lex [line 476]

string _lex( string $arg)

This method will implement various regular expressin rules based on pre-defined Arabic lexical rules



Tags:

return:  Regular Expression format to be used in MySQL query statement
author:  Khaled Al-Shamaa <khaled.alshamaa@gmail.com>
access:  protected


Parameters:

string   $arg   String of one word user want to search for

[ Top ]


Documentation generated on Fri, 12 Mar 2010 01:01:43 +0300 by phpDocumentor 1.4.0