[FLOW3-general] Question about associations and JsonView
Davide CD
dmichelangeli at hotmail.com
Mon Apr 23 20:52:28 CEST 2012
Hi Christian,
first of all thank you very much for your quick reply and sorry about the formatting.
Unfortunately, I can't get this to work.
In my Hotel Class I have a get method that simply returns my ArrayCollection of User objects:
public function getUsers(){ return $this->users; // "users" is a property of type ....\ArrayCollection<<\MyPackage\Domain\Model\User>>}
Now, if I set your configuration in my JsonView, I simply get the list of the hotels, in a JSON format but without users.
I don't know if there's something that I have to set somewhere else...
Thanks,Davide
> From: christian.mueller at typo3.org
> Date: Mon, 23 Apr 2012 09:13:07 +0200
> To: flow3-general at lists.typo3.org
> Subject: Re: [FLOW3-general] Question about associations and JsonView
>
> Hi Davide,
>
> unfortunately the formatting was quite disrupted in your mail, but the
> relation annotation looks good, you can even leave the targetEntity
> information out, we fill that in anyway.
>
> If you assign your hotel to "value" in your JsonView you would want to
> have a configuration as the following:
>
> array (
> 'value' => array (
> '_descend' => array (
> 'user' => array(
> '_descentAll' => array(
> )
> )
> )
> )
>
> )
>
> Should export the assigned hotel with all users.
>
> Cheers,
> Christian
>
> --
> Christian Mueller
> TYPO3 Core Team
>
> TYPO3 .... inspiring people to share!
> Get involved: typo3.org
> _______________________________________________
> FLOW3-general mailing list
> FLOW3-general at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general
More information about the FLOW3-general
mailing list