subclass and super method
Posted: Sat Aug 09, 2008 3:12 pm
Hi...
I have the class MasterDomain then I need to creat an extends class from this. But my HlmDomain class doesn't take the variable of its parent class. How could implement the 'super()' method or something similar in php?
Thanks
I have the class MasterDomain then I need to creat an extends class from this. But my HlmDomain class doesn't take the variable of its parent class. How could implement the 'super()' method or something similar in php?
Thanks
Code: Select all
class MasterDomain {
private $_dockey = "";
private $_renewal_dockey = "";
private $_promotion;
public static $_giftformname = "form1";
private $_new_subscriber = array ();
private $_magabbr = '';
private $_gift;
private $_transaction;
private $_universalID;
private $_single_account;
private $_discount_flag = "";
private $container;
private $_default_term_renewal = 5;
private $_process = NULL;
public function MasterDomain($dockey = "", $promotion = "", $magabbr = '', $renewaldockey="") {
$this->_dockey = $dockey;
$this->_promotion = $promotion;
$this->_renewal_dockey = $renewaldockey;
$this->_magabbr = $magabbr;
$this->_gifts = new Gifts();
$this->_transaction = new Transaction();
$this->_single_account = new Account();
$this->container = new Container();
}
}
class HlmDomain extends MasterDomain {
public function HlmDomain($dockey = "", $promotion = "", $magabbr = 'hlm', $renewaldockey="") {
$this->_dockey = $dockey;
$this->_promotion = $promotion;
$this->_renewal_dockey = $renewaldockey;
$this->_magabbr = $magabbr;
$this->_gifts = new Gifts();
$this->_transaction = new Transaction();
$this->_single_account = new Account();
$this->container = new Container();
}
}