You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I watched the video tutorials by Mateus which were very useful, but the data model he is working with has the entity reference on the parent content type. Unfortunately the data model I'm working with has the entity reference on the child content type, like so:
Parent: Organization has no entity reference fields
Child: Campaign has an entity reference field pointing to the organization
I want my organization resource to include relationships for each campaign associated with that organization. Is there a simple way to do that?
I've tried this, where $this->campaigns returns an array of nids, which didn't work:
I watched the video tutorials by Mateus which were very useful, but the data model he is working with has the entity reference on the parent content type. Unfortunately the data model I'm working with has the entity reference on the child content type, like so:
Parent: Organization has no entity reference fields
Child: Campaign has an entity reference field pointing to the organization
I want my organization resource to include relationships for each campaign associated with that organization. Is there a simple way to do that?
I've tried this, where $this->campaigns returns an array of nids, which didn't work:
// Add campaigns as references. $public_fields['campaigns'] = [ 'callback' => [$this, 'campaigns'], 'resource' => [ 'name' => 'campaign', 'majorVersion' => '1', 'minorVersion' => '0', ], ];
The text was updated successfully, but these errors were encountered: