$this->Conn->Query('UPDATE '.$object->TableName.' SET PrimaryCat = 0 WHERE '.$table_info['ForeignKey'].' = '.$table_info['ParentId']);
$this->Conn->Query('UPDATE '.$object->TableName.' SET PrimaryCat = 1 WHERE ('.$table_info['ForeignKey'].' = '.$table_info['ParentId'].') AND (Id = '.$id.')');
}
$event->SetRedirectParam('opener','s');
}
/**
* Removes primary mark from cloned category items record
*
* @param kEvent $event
* @return void
* @access protected
*/
protectedfunctionOnAfterClone(kEvent$event)
{
parent::OnAfterClone($event);
$config=$event->getUnitConfig();
$sql='UPDATE '.$config->getTableName().'
SET PrimaryCat = 0
WHERE '.$config->getIDField().' = '.$event->getEventParam('id');
$this->Conn->Query($sql);
}
/**
* Deletes items of requested type from requested categories.
* In case if item is deleted from it's last category, then delete item too.