Fields that are defined with INITVAR() need to have database functions specifiable.. For higher functions of mySQL and other databases..
ie:
/**
* Class for Spiders
* @author Simon Roberts (simon@xoops.org)
* @copyright copyright (c) 2000-2009 XOOPS.org
* @package kernel
*/
class HigherdbFunctions extends XoopsObject
{
function HigherdbFunctions($fid = null)
{
$this->initVar('baseid', XOBJ_DTYPE_INT, null, false);
$this->initVar('cid', XOBJ_DTYPE_INT, null, false);
$this->initVar('crypted', XOBJ_DTYPE_INT, null, false, false, false, false, array('mysql'=>array('insert'=>'AES_CRYPT("%value%", "Encryption Salt")', 'update'=>'AES_CRYPT("%value%", "Encryption Salt")', 'select'=>'AES_DECRYPT(`%field%`, "Encryption Salt")')));
$this->initVar('md5', XOBJ_DTYPE_INT, null, false, false, false, false, array('mysql'=>array('insert'=>'MD5("%value%")', 'update'=>'MD5("%value%")', 'select' => '`%field%`')));
$this->initVar('created', XOBJ_DTYPE_INT, null, false);
$this->initVar('actioned', XOBJ_DTYPE_INT, null, false);
$this->initVar('updated', XOBJ_DTYPE_INT, null, false);
}
}
As well as there needs to be a strapping for modules like onInstall, onUpdate and onUninstall for preference changes in system called onPreferences for when particular details like salts and other information are changed.
This is so if you are using crypt functions for example and a database and someone changes the salt in the preferences then you can patch the values in the database, the need to be passed the new preferences values with the old preference values as well so there would be a pre function as well as a post function for this the pre is passed the new values and the post is pasted the old values.