HI!
So I am following @admin's advice in this post:
www.j-cook.pro/forum/7-design-your-appli...extra-on-form-submit
So I am looking at the function prepareQuery() wondering how I am going to do this. Part of the problem is that I typically program in procedural form and not object oriented. (I am old you see.)
So, if someone could give me a clue here I would appreciate it. In the form I have built in a
Bool on the admin side. If I check that box when creating a record, it means I need to run my own function on the backend after submit. Now I have looked at the Joomla 2.5 documentation. The section I need has not been written yet. Awesome.
So, here is what I would normally do:
if($_POST['my_bool'] == 'true'){
runMyCustomFunction();
}
So here is where my problem starts. I don't see where in ./models/xxxx.php this is being processed. This is the content of the prepareQuery() function:
protected function prepareQuery(&$query, $pk)
{
//FROM : Main table
$query->from('#__skm_trialkeys AS a');
switch($this->getState('context'))
{
case 'trialkey.trialkey':
//BASE FIELDS
$query->select( 'a.id,'
. 'a.admin_notes,'
. 'a.asset_name,'
. 'a.create_key,'
. 'a.created_by,'
. 'a.encoder,'
. 'a.lickey,'
. 'a.mac_address');
//SELECT
$query->select('_created_by_.name AS `_created_by_name`');
$query->select('_encoder_.name AS `_encoder_name`');
//JOIN
$query->join('LEFT', '`#__users` AS _created_by_ ON _created_by_.id = a.created_by');
$query->join('LEFT', '`#__skm_optionencodertemplates` AS _encoder_ ON _encoder_.id = a.encoder');
break;
default:
//SELECT : raw complete query without joins
$query->select('a.*');
break;
}
//SELECT : Instance Add-ons
foreach($this->getState('query.select', array()) as $select)
$query->select($select);
//JOIN : Instance Add-ons
foreach($this->getState('query.join.left', array()) as $join)
$query->join('LEFT', $join);
//WHERE : Item layout (based on $pk)
$query->where('a.id = ' . (int) $pk); //TABLE KEY
//WHERE : Access
//WHERE : Publish, publish date (state field)
}
So, I am confused. Probably because I am old and wished Fortran was back in style. Can someone clue me in here?