Quote from: OpenGeek at Mar 10, 2010, 06:17 AM
Quote from: paulkoan at Mar 09, 2010, 04:46 PM
Err - the OP is discussing methods of accessing lists of chunks in a category. That is what is being discussed here as much as anything.
Er, well, the topic is "Is @SELECT bad form in Revo?" and I am suggesting that yes it should be considered bad form. In addition, I was identifying what needs to be done so that we can remove our dependence on it in the near future, i.e. address the access it provided historically, such as this one example.
Heh, I *know* you are not suggesting that the topic title means that no other aspects of the OP should be discussed right?
Quote from: paulkoan at Mar 09, 2010, 04:46 PM
Yes the general for SQL access would be solved by xPDO access via TV inputs - but the more specific case of accessing modx objects such as chunks to develop dynamic TVs based on chunks or documents?
MODx is xPDO extended, so maybe you are just not understanding that the same methods are used to access any xPDO-based object. MODx provides some extra methods related to the CMS domain, but for all intensive purposes you are using the xPDO API when you do anything with the MODx Core in Revolution.
I see what you are saying - the MODx CMS API just wraps around xPDO to get to the underlying data objects, so if we want to access modx CMS objects, then we may just as well use xpdo directly rather than the modx CMS API - ie treat the modx tables and objects like any other data access.
This is a little different to the approach I normally take, which is to avoid direct access to MODx (or any other system) tables whereever possible (including via an ORB), instead preferring the highest level API provided. My reasoning is that the modx API provides a ’contract’ - where if I ask the API to get something or set something, it will do it, and how it does it isn’t relevant to me. So if down the line, a dramatic change was necessary to the object model, tables, or anything else abstracted by the API, the MODx API would still just do its job and my code would still work.
But I appreciate that the API cannot abstract everything I would ever want to do, and so xpdo is certainly a lot better than direct SELECTs.
Quote from: paulkoan at Mar 09, 2010, 04:46 PM
It would be good if API calls could be made from TV inputs also...
That’s what a Snippet provides, the ability to call API methods, so yes, that is what I am suggesting by allowing MODx tags to be processed inside these values.
A snippet as a TV input would add an extraordinary level of flexibility to TVs - it would be a great addition.