Implements the Phrasebook pattern for SQL statements
This class implements the phrasebook pattern, as documented by Yonat Sharon and Rani Pinchuk in their paper, The Phrasebook Pattern available at http://jerry.cs.uiuc.edu/~plop/plop2k/proceedings/Pinchuk/Pinchuk.pdf. It uses similar calls and XML document format to Rani Pinchuk's Class::Phrasebook module for Perl.
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:
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:
SET field1 = 123
WHERE field4 = 456
The phrase with variables replaced if appropriate
Overrides Phrasebook::getPhrase() (Returns the phrase from the dictionary and will substitute variables when appropriate.)
a_stName The key of the phrase to return
a_astValues Array of strings to replace variables in the phrase with