FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Usage of class constants inside strings and heredocs
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Usage of class constants inside strings and heredocs [message #170514 is a reply to message #170513] Fri, 05 November 2010 12:11 Go to previous messageGo to previous message
Giuseppe Sacco is currently offline  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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Free Web Space for our Experiments
Next Topic: There is some framework/tool to generate PHP code
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 22 08:56:32 GMT 2024

Total time taken to generate the page: 0.05020 seconds