我尝试加载一个实体的一些细节,并在实体中有一个resellerId。PHP的继承超类变量
现在我继承它的一个子类,并尝试访问resellerId但它不在那里。如何将属性传递给子类?我真的需要它加载。
谢谢!
编辑:
class Crm_Entity extends Crm_Abstract {
protected $_mapper = 'Crm_Mapper_Entity';
protected $_data = array(
'customerId' => '', //done
'displayName' => '', //done
'active' => '', //done
'billingMethod' => '', //done
'debitorNumber' => null, //done
'bankAccount' => null, //done
'bankAccountTown' => null, //done
'resellerOrganisationId'=> null,
'account' => null, //done
'phonenumbers' => null, //done
'calls' => null,
'tickets' => null,
'comments' => null,
'addresses' => null,
'emailaddresses' => null, //done
'actionevents' => null
);
}
class Crm_CustomerEntity extends Crm_Entity {
//foobar not done yet
}
class Crm_Person extends Crm_CustomerEntity {
protected $_data = array(
'customerId' => null,
'firstName' => '',
'middleName' => '',
'lastName' => '',
'initials' => '',
'title' => '',
'openingWord' => ''
);
}
所以我需要得到resellerId传递到子类。
请显示一些代码,否则很难说出任何内容。 – enricog 2010-08-05 09:59:43
你能提供更多细节吗?请添加负责定义类,属性,子类的类定义的片段;访问财产。 – 2010-08-05 10:00:09
添加了一些代码,也许我在做一些非常愚蠢的事情...... – baklap 2010-08-05 10:18:41