string getPhrase(
string
$a_stName, [array
$a_astValues = array()])
|
|
Returns the phrase from the dictionary and will substitute variables when appropriate.
One major difference between PhrasebookSql and the standard Phrasebook is that the PhrasebookSql class will remove lines from the SET part of the UPDATE method if those variables are not used. This results in the ability to define only one update statement but only updating some of the fields.
For example if the following statement is defined in the dictionary:
UPDATE my_table
SET field1 = $field1,
field2 = '$field2',
field3 = $field3
WHERE field4 = $field4
And you only pass the array ("field1"=>"123", "field4"=>"456"), the following statement will be produced:
UPDATE my_table
SET field1 = 123
WHERE field4 = 456
Tags:
Overrides
Phrasebook::getPhrase() (Returns the phrase from the dictionary and will substitute variables when appropriate.)
Parameters:
void setDoMysqlEscapeString(
boolean
$a_boDoMysqlEscapeString)
|
|
Registers the value of the DoMysqlEscapeString.
When true, getPhrase will replace variables in the phrase that are surrounded by quotes to be run through the mysql_escape_string function. When false, the value of EscapedQuote will be used instead.
Parameters:
void setEscapedQuote(
string
$a_stEscapedQuote)
|
|
Registers the value of the string to use to replace single quotes (') with when variables are surrounded by quotes in the phrase.
This defaults to two single quotes ('')
Parameters:
void setUseIsNull(
boolean
$a_boUseIsNull)
|
|
Registers the value of the UseIsNull setting.
When true, getPhrase will change the text '= NULL' with 'is NULL'. When false, no changes to the phrase will occur.
Parameters: