Replies: 1 comment
-
@mastef I will do my best to address these questions, or at least add some relevant info. Some of this can only be answered by @sc0ttkclark
The two classes do not have a consistent naming schemes and I agree with @mastef that the naming scheme used in the Pods class is confusing. Is it worth deprecating methods to create a clearer naming scheme? I don't know. To answer your question more directly, both of the export methods in the Pods class, are preparing data for PodsAPI::export_pod_item(). But, I don't see any way for Pods::export_data() to export an item of a specific ID, whereas, Pods::export() has a parameter for ID.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Instead of writing multiple tickets, let me summarize my questions regarding export/export_data here :
1. terminology
I am a little uncertain about the difference of ->export() and ->export_data(). Basically export() expects a certain item (1) to be selected, and export_data() works on a set of items. So if limit on items would be 1, would export_data() behave in the same way?
Could we assume that export() is actually export_data_item() ? Right now I'm a bit confused about the generic terminology, as 'export' returns less than 'export_data'.
In that sense why do we have 2 functions with different names? Why not just use export() on the selected data set?
2. export exporting too much
Currently I'm using export with json API exports of data. In this case let's assume one item has multiple double-relationship fields - e.g. car has the double-relationship fields manufacturer, tires and engine. If you export now the car item, you will have also the items of the linked relationships ( which is good ), however in the linked relationships, those will include the car item as well. So we have a lot of redundant data in that sense.
It would be great if we could omit that, as we already have that info. Not sure if there is a use-case for it to be there twice.
3. export returning too little
When exporting a
user
field, we only get the main info per user, so that is username, id, email, etc. And also the extended pods keys/values. Which is good.However, it would be also great if we could include all of the user meta data of that user as well ( optional? ). The current method of enhancing each user with a separated get_user_meta call is a bit tedious, as get_user_meta wraps every key->value combination into an additional array. It would be great to have it all returned through pods.
Beta Was this translation helpful? Give feedback.
All reactions