class PagOptionsView extends PaginationView {
var $dbAP;
function PagOptionsView($id) {
if (!is_object($this->dbAP)) $this->dbAP =& new DBActionPerformer($id);
}
}
Honestly that is the very closest I can get in PHP to the Java construct:
public class PagOptionsView extends PaginationView implements DBActionPerformer {}
Goal is that I want to have a PagOptionsView class instance that contains a property $dbAP that is a DBActionPerformer object..
Problem is that I'd like to call it statically as well:
PagOptionsView::getDBAP()
Which fails because PagOptionsView has to be instantiated in order for this to happen sice $this->dbAP is constructed in the constructor.
I'm just plain confused and I don't want to have to instantiate objects all over the place to get just one value, I want the elegance of the Java "implements" feature of implementing abstract classes into an existent PHP class but I don't know how.
Could someone help me out here?
Thanx
Phil