我们正在尝试从旧版本的 Zend Framework 升级到最新版本 (1.11)。
我们必须将一些 ArrayCollections 发送到我无法访问的 Flex 应用程序。以前版本的 ZFZend_Amf_Value_Messaging_ArrayCollection
有一个source
新版本没有的属性。
我曾尝试编辑Zend_Amf_Value_Messaging_ArrayCollection
该类以具有该source
属性,但似乎 ZF 不会将对象发送到 Flex 应用程序(我已经通过调试代理注意到了这一点)。ArrayCollection 仍然具有正确的键(AFAIK,从 0 -> 3),但值为NULL
.
这是来自一个小的测试文件:
$c = new RoomCategoryVO();
$c->name = 'root';
$c->childCategories = new Zend_Amf_Value_Messaging_ArrayCollection();
$cc1 = new RoomCategoryVO();
$cc1->sortPriority = 2;
$cc1->name = $this->xml->roomService->windows;
$cc1->parentCategory = $c;
$cc1->childItems = new Zend_Amf_Value_Messaging_ArrayCollection();
$re11 = new ElementVO();
$re11->id = "simpleWindow";
$re11->name = $this->xml->roomService->window;
$re11->type = 'SIMPLE_WINDOW';
$re11->icon = 'assets/runtime/images/schemeIcons/simpleWindow.png';
//$cc1->childItems->source[] = $re11;
$cc1->childItems[] = $re11;
//$c->childCategories->source[] = $cc1;
$c->childCategories->append($cc1);
在评论中,您会看到 ZendAMF 的“旧”方式,在它们下方是新方式。
有没有办法让 ZendAMFsource
再次使用该属性而无需返回旧版本的 ZF?