Query to element criteria Is it possible to turn a query into an element criteria model? Currently I'm doing this:

$criteria = craft()-&gt;elements-&gt;getCriteria('Conference_Session');
$criteria-&gt;conferenceId = $conferenceModel-&gt;id;

$query = craft()-&gt;elements-&gt;buildElementsQuery($criteria);
$query-&gt;order("conference_session.cs_start_time ASC");

$queryResult = $query-&gt;queryAll();


I would prefer to be able to be able to add my MySQL commands then turn it back into a element criteria. I don't have to do this but I want to know if I could.
I think you want to have the same result as with an ElementCriteriaModel, instead of getting an ElementCriteriaModel.

What you want to do is mimic craft()-&gt;elements-&gt;findElements(), and put your own $query in it. This will more or less put the results in their models. You can just copy this function and replace the second line (where $query is defined) with your logics.

You could also do something like Conference_SessionModel::populateModels($queryResult), but by the way Craft joins the content table in findElements this would be rather slow, as it would make a new query for every content field.

What would be really nice is if you could specify $query in findElements, too bad Craft doesn't support this (yet?)