Very simple query:
$query = $db->getQuery(true)
->select('*')
->from('#__mail_templates')
->where('template_id = ' . $db->quote($this->getRowId()))
->where('language = ' . $db->quote($languageCode));
$rows = $db->loadObjectList($query);
For some ungodly reason, $rows has index "", empty string. Using Joomla 4.2. I hope this is not intended behaviour??
var dump:
array(1) {
[""]=>
object(stdClass)#218 (14) {
["lang_id"]=>
int(2)
["asset_id"]=>
int(66692)
["lang_code"]=>
string(5) "de-DE"
...
Oh, I see now that the result is not coming from the correct table even.
#message: "Unknown fetch type '8'"