Does anyone know a way to debug NotORM's requests?
I am able to get the SQL query it executes by printf-ing the NotORM object.
Example:
$models = $this->dbh->wh_product()->select("wh_model.id, wh_model.manufacturer, wh_model.model, wh_model.details, wh_model.wh_category.category, crm_contact.ragione")->order("wh_model.wh_category.id ASC, crm_contact.ragione ASC, wh_model.model ASC");
printf($models);
This gives:
SELECT
wh_model.id,
wh_model.manufacturer,
wh_model.model,
wh_model.details,
wh_category.category,
crm_contact.ragione
FROM
wh_product
LEFT JOIN wh_model ON wh_product.wh_model_id = wh_model.id
LEFT JOIN wh_category ON wh_model.wh_category_id = wh_category.id
LEFT JOIN crm_contact ON wh_product.crm_contact_id = crm_contact.id
ORDER BY
wh_category.id ASC,
crm_contact.ragione ASC,
wh_model.model ASC
I'm having problems with this query because if I manually execute this via phpMyAdmin I get something like 90 results, but NotORM gives me only 14.
Is there a way to understand what is happening with NotORM?
Thanks