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:

  • 2006-2010 Khaled Al-Shamaa

Variables

Methods



Class Details

[line 189]
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:  2006-2010 Khaled Al-Shamaa
link:  http://www.ar-php.org
license:  LGPL


[ Top ]


Class Variables

$allFormsInput =  'windows-1256'

[line 241]

"allForms" method input charset



Tags:

access:  public

Type:   String


[ Top ]

$allFormsOutput =  'windows-1256'

[line 235]

"allForms" method output charset



Tags:

access:  public

Type:   String


[ Top ]

$allFormsVars = array('arg')

[line 247]

Name of the textual "allForms" method parameters



Tags:

access:  public

Type:   Array


[ Top ]

$fields = array()

[line 191]



Tags:

access:  protected

Type:   mixed


[ Top ]

$getOrderByInput =  'windows-1256'

[line 223]

"getOrderBy" method input charset



Tags:

access:  public

Type:   String


[ Top ]

$getOrderByOutput =  'windows-1256'

[line 217]

"getOrderBy" method output charset



Tags:

access:  public

Type:   String


[ Top ]

$getOrderByVars = array('arg')

[line 229]

Name of the textual "getOrderBy" method parameters



Tags:

access:  public

Type:   Array


[ Top ]

$getWhereConditionInput =  'windows-1256'

[line 205]

"getWhereCondition" method input charset



Tags:

access:  public

Type:   String


[ Top ]

$getWhereConditionOutput =  'windows-1256'

[line 199]

"getWhereCondition" method output charset



Tags:

access:  public

Type:   String


[ Top ]

$getWhereConditionVars = array('arg')

[line 211]

Name of the textual "getWhereCondition" method parameters



Tags:

access:  public

Type:   Array


[ Top ]

$lexPatterns = array()

[line 192]



Tags:

access:  protected

Type:   mixed


[ Top ]

$lexReplacements = array()

[line 193]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


constructor __construct [line 252]

ArQuery __construct( )

Loads initialize values



Tags:

access:  public


[ Top ]

method allForms [line 625]

string allForms( string $arg)

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

[ Top ]

method allWordForms [line 527]

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 getArrFields [line 342]

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 330]

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 469]

string getOrderBy( string $arg)

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

[ Top ]

method getStrFields [line 355]

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 373]

string getWhereCondition( string $arg)

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

[ Top ]

method getWordLike [line 454]

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 internal 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 433]

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 internal 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 512]

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 ]

method setArrFields [line 275]

object setArrFields( array $arrConfig)

Setting value for $fields array



Tags:

return:  to build a fluent interface
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 313]

object setMode( integer $mode)

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



Tags:

return:  to build a fluent interface
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 294]

object setStrFields( string $strConfig)

Setting value for $fields array



Tags:

return:  to build a fluent interface
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 ]


Documentation generated on Sat, 14 Aug 2010 13:23:57 -0700 by phpDocumentor 1.4.0