New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SymQL-type methods to EntryManager #1157
Comments
I've been thinking about this some more when updating SymQL for 2.3. Otherthings that EntryManager should be doing:
My suggestion of adding an
This would internally build the where/joins and call EntryManager::fetch. |
Add sorting into the mix too. |
I completely support Nick's ideas. It's a shame that it's so hard to access/output entries using custom code. |
In relation to the discussion on PDO, I discovered this today — a DSL that performs joins behind the scenes for use in abstract table environments. Clever. Potentially very useful. The DSL syntax is almost identical to SymQL. |
I will encourage @rowan-lewis to release his Symphony API abstraction layer as an extension so users can play with that. As for core work, lets focus our efforts on an awesome API in Next, not S2. |
SymQL exists because at the time EntryManager was not fit for purpose. It still is not in my opinion, for the following reasons. If we can fix these, then SymQL becomes virtually redundant and EntryManager becomes awesome (and will make it almost the equivalent of a section datasource):
getData()
returns an array of data indexed by the entry's field IDs. I'm forever rebuilding this array to use field handles instead, so that it becomes more readable and usefulEntryManager::fetch()
one has to pass re-buildJOIN
andWHERE
SQL clauses. EntryManager should have ways to build this itself. Presently this logic is bundled insideSectionDatasource
. It had to be copied/pasted into SymQLEntry
cannot render itself as XML. Presently this logic is built intoSectionDatasource
. If I get entries back from EntryManager, I should be able to callasXML
or something to generate the XML representation. I had to duplicate this from the SectionDatasource logic in SymQLNow, this could be done in the core by amending
EntryManager::fetch
, but this method signature is already massive, and it would break backwards compatibility. So I suggest something like anEntryQuery
class in the core which wraps up this nastiness and makes grabbing filtered entries from Symphony a core pleasure rather than an extension hack.The text was updated successfully, but these errors were encountered: