Tariqa  3.0
 All Data Structures Namespaces Files Functions Variables Enumerations
unifiedQuerySyntax Class Reference

Public Member Functions

 __construct ($query, $config, $translation_key)
 translate ($tokens=null)

Static Public Member Functions

static timstamp ($date)
static getDatesCondition ($query)
static removeDatesCondition ($query)

Data Fields

const UNIFIED_QUERY_SYNTAX = 'UQS'
const ORIGINAL_SYNTAX = 'OS'

Protected Member Functions

 getFunctions ()
 getOperators ()
 getDelimiter ()
 getParantheses ()
 tokenize ($query)
 getTranslatedFunctions ($originals)
 getTranslatedOperators ($originals)
 getTranslatedDelimiter ($original)
 getTranslatedParantheses ($originals)

Constructor & Destructor Documentation

__construct ( query,
config,
translation_key 
)

Constructs the object

Parameters:
string$queryThe query string
array$configThe news configuration for translating the query
string$translation_keyThe key for the translation public
Returns:
void

Member Function Documentation

static getDatesCondition ( query) [static]

Extracts the dates conditions from the query Returns an associative array with the query and the date condition separated

Parameters:
string$queryThe query string public
Returns:
array
getDelimiter ( ) [protected]

Gets the delimiter from the news config file protected

Returns:
string
getFunctions ( ) [protected]

Gets the functions from the news config file protected

Returns:
string[]
getOperators ( ) [protected]

Gets the operators from the news config file protected

Returns:
string[]
getParantheses ( ) [protected]

Gets the parantheses from the news config file protected

Returns:
string[]
getTranslatedDelimiter ( original) [protected]

Gets the translated values for the delimiter

Parameters:
string$originalThe original delimiter protected
Returns:
string
getTranslatedFunctions ( originals) [protected]

Gets the translated values for the functions

Parameters:
string[]$originals The original functions values protected
Returns:
string[]
getTranslatedOperators ( originals) [protected]

Gets the translated values for the operators

Parameters:
string[]$originals The original operators values protected
Returns:
string[]
getTranslatedParantheses ( originals) [protected]

Gets the translated values for the parantheses

Parameters:
string[]$originals The original parantheses protected
Returns:
string[]
static removeDatesCondition ( query) [static]

Extracts the dates conditions from the query Removes any dates conditions set through the query string

Parameters:
string$queryThe query string public
Returns:
string
static timstamp ( date) [static]

Converts a date from any string format to a UNIX timestamp

Parameters:
string$dateThe date public
Returns:
int
tokenize ( query) [protected]

Splits the string in tokens

Parameters:
string$queryThe query string protected
Returns:
queryToken[]
translate ( tokens = null)

Translates a query from Unified Query Language to Specific Engine Language

Parameters:
queryToken[]$tokens The tokens to be translated [OPTIONAL] public
Returns:
string

Field Documentation

const ORIGINAL_SYNTAX = 'OS'
const UNIFIED_QUERY_SYNTAX = 'UQS'

The documentation for this class was generated from the following file: