AMFPHP's _explicitType implementation is used to define it however you
want.  So for my example of the BookVO, the php VO would look like:

class BookVO {
        public $_explicitType = "com.renaun.samples.login.vo.BookVO";
        public $name;
        public $bookid;
        public $publishdate;
        public $createddate;

}

And the PHP service class is:

include "../vo/BookVO.php";

class Login {

    function Login() {
        $this->methodTable = array(

                        "checkLogin" => array(
                "description" => "Simple Login",
                "access" => "remote",
                                "arguments" => array ()
            )

        );
        // Initialize db connection
    }

        function checkLogin() {
                $arr = array();
                $book = new BookVO();
                $book->name = "Adobe Flex 2: Training from the Source";
                $book->bookid = "032142316X";
                $book->publishdate = date( "F j, Y, g:i a", mktime(0, 0, 0, 8, 
31,
2006) );
                $arr[] = $book;
                $book = new BookVO();
                $book->name = "ActionScript 3.0 Cookbook : Solutions and 
Examples
for Flash Developers";
                $book->bookid = "0596526954";
                $book->publishdate = date( "F j, Y, g:i a", mktime(0, 0, 0, 9, 
1,
2006) );                
                $arr[] = $book;
                $book = new BookVO();
                $book->name = "Programming Flex 2 : The Comprehensive Guide to
Creating Rich Media Applications with Adobe Flex";
                $book->bookid = "059652689X";
                $book->publishdate = date( "F j, Y, g:i a", mktime(0, 0, 0, 11, 
1,
2006) );
                $arr[] = $book;                                 

                return $arr;
        }

}

Renaun

--- In flexcoders@yahoogroups.com, Julian Sander <[EMAIL PROTECTED]> wrote:
>
> Hi Renaun,
> 
> thanx for the responce!  I have gotten this far as well.  What I am  
> not clear on is what is being passed int eh responce from the server  
> to Flex that makes the alias work?  Is it still the _explicitType  
> property or is there something else?
> 
> cheers, Julian
> 
> Julian Sander
> Burbacherstraße 58
> 53129 Bonn
> 
> t/f     +49 228 21 27 15
> m      +49 172 250 6524
> 
> http://sander-is.com
> 
> 
> 
> 
> On 16.10.2006, at 21:24, Renaun Erickson wrote:
> 
> > AMFPHP uses _excplicitType or advancedmappings.php to make mapping
> > easier. With PHP 5 there is some class introspection code that makes
> > it possible to find the object mapping automacitally. Both SabreAMF
> > and WebORB for PHP supports the auto object mapping.
> >
> > As FDS and Coldfusion connectivity is based on Java it also is very
> > capable of class introspection and auto mapping.
> >
> > Basically the mapping as nothing to do with Flex.
> >
> > Now in regards to your question about Flex side of the VO mapping.
> > Here is a sample AS VO file I use in my WebORB for PHP example.
> >
> > package com.renaun.samples.login.vo
> > {
> >
> > import flash.net.registerClassAlias;
> >
> > [RemoteClass(alias="com.renaun.samples.login.vo.BookVO")]
> >
> > [Bindable]
> > public class BookVO
> > {
> > public var name : String;
> > public var bookid : String;
> > public var publishdate : String;
> > public var createddate : Date;
> >
> > }
> >
> > }
> >
> > You can even type the objects in ArrayCollections by this code:
> >
> > [Bindable]
> > [ArrayElementType("com.renaun.samples.vo.BookVO")]
> > private var books:ArrayCollection;
> >
> > Renaun
> >
> > --- In flexcoders@yahoogroups.com, "dr.swank" <dr.swank@> wrote:
> > >
> > > Hi List,
> > >
> > > I am working with CakePHP 1.2, CakeAMFPHP, and Flex2 SDK to develop
> > a fairly complex
> > > community portal. I can't say too much due to client restrictions,
> > so I will ask my
> > > questions is a very broad way.. :)
> > >
> > > I know that, in AMFPHP for AMF0 there was a var sent back to Flash
> > called _excplicitType
> > > which, when used with Object.registerClass() would map the reurned
> > value object to the
> > > appropriate class. I had all that working, so how it runs is not a
> > problem. My issue comes
> > > up with AMF0 anf Flex2:
> > >
> > > 1. what is/are the flag/flags that Flex looks for to map returned
> > objects to their
> > > counterparts inside the FLex App?
> > >
> > > 2. Is Cairngorn the better way to deal with this issue?
> > >
> > > For those who are not familiar with CakePHP, it is a Data Modeling
> > Framework ( well,
> > > among other things) which returns Models and assosiated values. So
> > if a User had many
> > > Ariticles, then Cake would retun a User object which would contain a
> > Article object
> > > containing all the articles for the User.
> > >
> > > Any hint, tips, etc would be greatly appritiated,
> > >
> > > cheers, Julian (aka drSwank)
> > >
> >
> >
> >
>





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to