5
Hi Trabis sorry to worry u again i tried the method u shown above to retrieve data from database but i am getting this error
atal error: Call to a member function getVars() on a non-object in C:\xampp\htdocs
here is my class
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');
}
}
?>
here i am trying to retireve
$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
6
Thanks Trabis for your easy explanation. Trabis The Xoops's Future...
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?
10
How do i use assign template in admin section?
173 user(s) are online (94 user(s) are browsing Support Forums)
Members: 0
Guests: 173
more...
Stats |
Goal: |
AU$15.00 |
Due Date: |
Jul 31 |
Gross Amount: |
AU$0.00 |
Net Balance: |
AU$0.00 |
Left to go: |
AU$15.00 |
|