fix, and it has to do with multiple inheritances whereby something is
lost.
Class EditView is a child of PagOptionsView
Class Addview is a child of AssocView
EditView's constructor will call a "super()" onto PagOptionsView as so:
[PHP]parent::PagOptionsView($id, $errorArray);[/PHP]
EditView's constructor will next instantiate an AddView object for
itself:
[PHP]$this->addView =& new AddView($this->id, $this->errorArray);[/PHP]
AddView's constructor will call a "super()" onto AssocView as so:
[PHP]parent::AssocView($id, $errorArray);[/PHP]
PagOptionsView's constructor instantiates a DBActionPerformer object as
so:
[PHP]$this->dbAP = new DBActionPerformer($id);[/PHP]
AssocView's constructor instantiates a DBActionPerformer object as so:
[PHP]$this->dbAP =& new DBActionPerformer($id);[/PHP]
DBActionPerformer's constructor instantiates a DBConnection object as
so:
[PHP]$this->dbConnObj = new DBConnection($dbHost, $dbPort, $dbUser,
$dbPwd, $dbDefaultName);[/PHP]
Now, when I instantiate an EditView object, I have a method,
displayHTML() that will display HTML of stuff. I can do this and
everything works beautifully:
[PHP]$result = $this->dbAP->select(); // RESULTSET EVERY TIME [/PHP]
However, were I do this, again, in EditView's displayHTML() method:
[PHP]$html .= $this->addView->displayHTML();
I get the following error:
...function on a non-object in ...This occurs because the following doesn't exist as an object:
$this->addView->dbAP->dbConnObjWhereas this exists:
$this->dbAP->dbConnObjWhat is going on? The DBConnection object is somehow nonexistent in
one method of inheritance but found in another. I need someone who
really REALLY knows their OO PHP (or can fake it good enough) to help
me with this one, I'm totally stuck!
Thanx
Phil