views:

176

answers:

0

I have a php/flex value object that I am using to transmit data to/from in my application. Everything works great php->flex, but I am having an issue with flex->php.

In my MergeTemplateService.php service I have the following code. This is the method that flex hits directly:

function updateTemplate($valueObject){
    $object = DAOFactory::getMergeTemplateDAO()->update($valueObject);
    return $object;
}

I am passing a value object that from flex looks like this:

(com.rottmanj.vo::MergeTemplateVO)#0
communityID = 0
creationDate = (null)
enterpriseID = 0
lastModifyDate = (null)
templateID = 2
templateName = "My New Test Template"
userID = 0

The issue I am having is that my updateTemplate method sees the value object as an array and not an object.

In my amfphp globals.php I have set my voPath as: $voPath = "services/class/dto/";

Any help with this is greatly appreciated

Here are my two value objects: AS3 VO:

package com.rottmanj.vo
{

[RemoteClass(alias="MergeTemplate")]

public class MergeTemplateVO
{
    public var templateID:int;
    public var templateName:String;
    public var communityID:int;
    public var enterpriseID:int;
    public var userID:int;
    public var creationDate:String;
    public var lastModifyDate:String


    public function MergeTemplateVO(data:Object = null):void
    {
        if(data != null)
        {
            templateID = data.templateID;
            templateName = data.templateName;
            communityID = data.communityID;
            enterpriseID = data.enterpriseID;
            userID = data.userID;
            creationDate = data.creationDate;
            lastModifyDate = data.lastModifyDate;
        }           
    }   
}
}

PHPVO:

<?php
class MergeTemplate{

    var $templateID;

    var $templateName;

    var $communityID;

    var $enterpriseID;

    var $userID;

    var $creationDate;

    var $lastModifyDate;

    var $_explictType = 'MergeTemplate';


}
?>