Re: Usage of class constants inside strings and heredocs [message #170514 is a reply to message #170513] |
Fri, 05 November 2010 12:11 |
Giuseppe Sacco
Messages: 5 Registered: November 2010
Karma:
|
Junior Member |
|
|
oops, I forgot to add the part about class constants in strings...
in all derived classes, I have special method for common operations on
specific tables. As an example, delete records:
class Comunicazioni extends Table {
// declare all field as class constants
// ...
public function CreaDeleteStatemnt() {
return "DELETE FROM {$this->nometabella}\nWHERE
".Comunicazioni::DB_COD_ANAG."=\$1 AND
".Comunicazioni::DB_COD_ORIGINALE."=\$2";
}
} // end class Comunicazioni
This is where I would like to use heredoc: I am in a derived class, so
I do not need reflection, and I need to create a prepared statement,
so I use placeholders instead of real values.
Bye,
Giuseppe
|
|
|