I am using a view / layout of film.monetize
In the old version of JCook, before ORM I used to do this to call data from another table on the fly
$modelContracts = CkJModel::getInstance('contracts', 'MyComponentModel');
$modelContracts->setState('context', 'contracts.monetize');
switch ($this->item->type) {
case "1":
$modelContracts->addWhere('a.films = 1');
break;
case "2":
$modelContracts->addWhere('a.shorts = 1');
break;
case "3":
$modelContracts->addWhere('a.series = 1');
break;
default:
break;
}
$modelContracts->addSelect('(select count(*) FROM #__mycomponent_xtitlecontracts WHERE contract=a.id AND title=' . $_GET['id'] . ') as count');
$modelContracts->addSelect('(select b.id FROM #__mycomponent_xtitlecontracts AS b WHERE b.contract=a.id AND b.title=' . $_GET['id'] . ' LIMIT 1) as linkID');
$modelContracts->addSelect('(select c.payment_status FROM #__mycomponent_xtitlecontracts AS c WHERE c.contract=a.id AND c.title=' . $_GET['id'] . ' LIMIT 1) as paymentStatus');
$modelContracts->addWhere('a.published = 1');
$modelContracts->addOrder('a.contract_name');
$contracts = $modelContracts->getItems();
I am now in the process of converting one of my largest components to ORM and I have ZERO clue how to get started on this.
I have written the model for contracts.monetize no problem bit now I need to call this data from another view
As I starting point to just pulling in the WHOLE model I did
$modelContracts->orm(array(
'context' => 'contracts.monetize'
));
but I get
Call to a member function orm() on null
Any tips to getting started are appreciated as the documentation doesnt quite have the situtaiton, and the only help I found in the forum was using an instance getData which I cant find in the documentation