[nycphp-talk] Help with a self:: ish problem
Rick Retzko
rick at click-rick.net
Thu Dec 6 10:29:09 EST 2007
Hi Cliff - Thanks. Maybe I'm using the wrong implementation here. My
design is that $this->_aData['action'] could resolve to an 'update',
'insert' or 'delete' request and thus be directed to the appropriate
function. I didn't want to use a literal, but have the decision made by the
calling routine.
Best Regards -
Rick
============
rick at click-rick.net
_____
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org] On
Behalf Of Cliff Hirsch
Sent: Thursday, December 06, 2007 10:20 AM
To: NYPHP Talk
Subject: Re: [nycphp-talk] Help with a self:: ish problem
class actions {
private function update(){
echo 'Update being executed!';
return TRUE;
}
//public functions ==================================
public function do_action($table,$data){
//direct action activity
//assumption: $data['action'] will contain action definition
$this->_table=$table;
$this->_aData=$data;
$completed=self::update(); //<== THIS IS THE PROBLEM LINE
Try $completed=$this->update()
Update is not a static function. If you want to use self, use static
function update().....
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20071206/bf86af91/attachment.html>
More information about the talk
mailing list