ClassModelList::loadXref()DeprecatedPlease use the Relations instead.
This function is a great support to automatically populate a new array property in the item(s) containing a cross-reference list.
Instance a crossed listThe following example explains the function declaration. loadXref() must be called from populateObjects() of the model (item model or list model) In case of an item model, the declaration varies. $items becomes $item. ContextThe given context is deciding wich columns are loaded in memory (SQL query). If you haven't created 'object.default', then create it in prepareQuery() or use an existing profile : [view].[template] The N:M tutorial is putting as this in pratice.
Usage in componentPer default, the Xref list is not loaded in the model. $model->setState('xref.cities', true); You can change model state only BEFORE getItem()
Note of the conceptorIn case of list, it does globally the same job than item for the moment, but it will be impoved and optimized in future. A SQL is actually requested for every row. It could be optimized to load all concerned items at once and then dispatch them into their respective parents. |
|
I found "cook" two days ago. Played around with it for a day and then within a day got rid of two legacy applications in IBM Lotus Domino Notes and replaced them with "cook". It was really easy. A piece of cake. Actually it was even easier than cooking. Cooking involves more work than developing with "cook". What can I say about "cook"? Great application great price for what it delivers great forum with a lot of information and fast responses active and friendly community fast forward moving development cycle So what should I say "Monsieur Le Cook"? Keep the good work going it will lead to success. Having become a paying member in the words of Edith Piaf may I say ..... non rien de rien ... je ne regrette rien. Vive La France.