• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

getting nested valueObjects from a data-service

Explorer ,
Jul 22, 2011 Jul 22, 2011

Copy link to clipboard

Copied

I'm working FB 4.5 for PHP.  I'm very intrigued by the data/service design pattern and the way FB automatically configures a valueObject with getters and setters, and the way the connection to the server is abstracted.

However, I have a few questions, and I'm concerned that the automation my complicate what I wish to do.

I've created a service that returns an array of objects of type "Setting", which in turn has properties including other objects and arrays of objects.

When I use the data/service wizard, it automatically creates a valueObject called "Setting".

I'd like to extend Setting so that valueObjects for the nested objects are created.  I can use the wizard to create the appropriate valueObjects by calling methods in my service that return instances of these objects.

The next step would be to modify the Setting class so that as instances are being created, the data for the nested objects are passed on to create client-side instances of the corresponding valueObjects.

E.g., lets say that the primary valueObject being returned is Person, but each Person has a corresponding array of Like objects.  I'd like to modify the Person object so that when the data comes down from the server, corresponding "Like" objects are created.

How would I do this?

Thanks!

TOPICS
PHP

Views

303

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 23, 2011 Jul 23, 2011

Copy link to clipboard

Copied

LATEST

Well, there was a problem with my data service.  Once I fixed it, the data/service wizard allowed me to define multiple valueObjects for the nested objects.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines