【发布时间】:2013-11-12 14:52:36
【问题描述】:
当我对数组 $mailer 进行 var_dump 时,我得到:
object(Fooman_EmailAttachments_Model_Core_Email_Template_Mailer)#352 (8) {
["_emailInfos":protected]=>
array(3) {
[0]=>
object(Mage_Core_Model_Email_Info)#409 (11) {
["_bccNames":protected]=>
array(0) {
}
["_bccEmails":protected]=>
array(0) {
}
["_toNames":protected]=>
array(1) {
[0]=>
string(13) "My Name"
}
["_toEmails":protected]=>
array(1) {
[0]=>
string(17) "justatest@test.com"
}
["_data":protected]=>
array(0) {
}
["_hasDataChanges":protected]=>
bool(false)
["_origData":protected]=>
NULL
["_idFieldName":protected]=>
NULL
["_isDeleted":protected]=>
bool(false)
["_oldFieldsMap":protected]=>
array(0) {
}
["_syncFieldsMap":protected]=>
array(0) {
}
}
我想编辑_toEmails,但如何访问和编辑它?
【问题讨论】:
-
你不能直接这样做。我不知道您正在使用的库,但它可能有一个 setter 方法来更改此值,例如
$object->setToEmails -
它不是一个数组而是一个对象。请向我们展示
Fooman_EmailAttachments_Model_Core_Email_Template_Mailer类的代码,可能该属性有一个setter 方法。
标签: php object visibility