symphonycms / remote_datasource

An improved datasource to fetch data from TXT, CSV, XML and JSON sources.
Other
14 stars 9 forks source link

Added the $this->visitData($data); function #14

Closed nitriques closed 10 years ago

nitriques commented 10 years ago

This is very similar to this PR: https://github.com/symphonycms/remote_datasource/pull/12

This allows custom remote data source to be able to 'act' on the data before it no longer available to php.

brendo commented 10 years ago

When would this be useful?

Is this something that a delegate would do better?

nitriques commented 10 years ago

When would this be useful?

We have some data sources that needs to be able to "play" with the data in order to properly format them. We also sometimes need to "clean up" the data.

Is this something that a delegate would do better?

I think so yes. Do you want me to re-implement it using a delegate ? Which name should it have ?

nitriques commented 10 years ago

Finally, a delegate would be nice, but the use case for the function (which is to target only one DS or a subset of DSes) is still way better.

And it won't require me to create phony extensions just to customize the output of some DS. Modiying the data can save the day with slow remote DS. Parsing xml is sometimes slow.