Sunday 27 July 2003 11:45:58 am
Hi, I've been building modules and now there are almoust ready... Important feature that I'm missing is saving data to database. Some hints how to do this would be extremely helpfull... Here's what I'm doing right now:
I have a file witch keeps inside all the functions that happens inside my module...
File: Adds.php:
----------- include_once( 'kernel/classes/ezpersistentobject.php' );
class Adds extends eZPersistentObject
{ var $AddsID=NULL;
function Adds( $row )
{
$this->eZPersistentObject( $row ); }
function &definition()
{
(Definitions here...) }
function &createAdds( $AddsID, $currentUserID, $data1, $data2...etc )
{
$Added = Adds::currentDay(); $Expires = Adds::createExpTime($OldRule);
$row = array(
'id' => $AddsID,
'user_id' => $currentUserID,
'Added' => $Added,
'Expires' => $Expires,
'Data1' => $data1,
'data2' => $data2, etc.... );
return new Adds( $row ); } ...Some more functions... ---------------
What should I do now, to get the data _saved_ in the _database_?
Should I execute somewhere this eZPersistentObject's function "store"? And if should, where? Right now it stops in the function "fill"... Right? You can get the Idea how the rest of the module is done, by looking that tutorial that I sended before...
Someone from eZ crew, please help... I think this is easy and fast to answer.
Thanks, Jerry
|