if (!defined("XOOPS_ROOT_PATH")) {
die("XOOPS root path not defined");
}
//create the xoopsobject for crud opeation
class AudioAudio extends XoopsObject
{
function AudioAudio()
{
$this->__construct();
}
function __construct()
{
$this->initVar("id", XOBJ_DTYPE_INT);
$this->initVar("source", XOBJ_DTYPE_TXTBOX);
$this->initVar("title", XOBJ_DTYPE_TXTBOX);
$this->initVar("download", XOBJ_DTYPE_TXTBOX);
$this->initVar("size", XOBJ_DTYPE_TXTBOX);
$this->initVar("type", XOBJ_DTYPE_TXTBOX);
$this->initVar("date", XOBJ_DTYPE_TXTBOX);
}
}
class AudioAudioHandler extends XoopsPersistableObjectHandler
{
function AudioAudioHandler(&$db)
{
$this->__construct($db);
}
function __construct(&$db)
{
parent::__construct($db, 'audios', 'AudioAudio', 'id');
}
}
?> $obj_handler =& xoops_getModuleHandler('audio','audio');
$obj = $obj_handler->getAll($criteria = null, $fields = null, $asObject = true, $id_as_key = true);
echo "".$obj->getVars("source")."
".$obj->getVars("title")."
".$obj->getVars("type")."
".$obj->getVars("date")." ";
in a debug it shows select * from audios but it i canot list the data due to the error above
7
ok thanks a lot understood the object handler, about criteria still confused. is critirea about setting like where clause, limit, orderby, groupy etc or something else?
8
I went through Faq module by catzwolf it is using normal quries. I am trying to understand and if anyone here to explain me how to extend xoopsobjecthandler class to create module_handler. or may be i am not understanding how to explain properly.
9
I am developing a module i want to use XOOPS Object handler for creating and updating the records in database. But can please any one explain to me how the objecthandler (module_handler) class works?? How can i extend the class?
Login
Search
Recent Posts
Who's Online
Donat-O-Meter
Latest GitHub Commits