Issues with export

18 views
Skip to first unread message

glo...@gmail.com

unread,
Jul 16, 2016, 1:55:24 PM7/16/16
to redbeanphp
Hi,
I am using redbeanphp 4.3.2 and encountered a behavior which i am uncertain whether it is by design or me doing something wrong.

Situation:
I have two beans: document and provider. Each document has one provider. I assign provider like this:
$document->provider = $provider;
This saves to the database just fine, and i can access provider bean from document bean later by doing
$provider = $document->provider;
after loading document from database.

Issue:
I am trying to export given document and all related beans to json.
I tried exporting to array first using
R::exportAll($document);
but that exports "provider_id":"1" and does not export provider.
Is this intentional, and i have to write code that will "manually" attach relevant data, or is this me doing something wrong?

gabor

unread,
Jul 17, 2016, 1:56:12 PM7/17/16
to redbeanphp
Have you tried

R
::exportAll($document, true);

?


Reply all
Reply to author
Forward
0 new messages