modeling a data table

Sebastian

Member
Hi, I'm new to XenForo and new to ZF too, I have some experience with CakePHP, so...

As good practice in modeling a table, the fields are generally used "create", "modify" and "delete" which is intended to keep a track level database when the row was affected in some way. ..

then the question is how do XenForo handle this form of control, and if not, then why not?


thank you in advance!
 
Do you mean when creating an add-on?

$db = $this->_getDb();

$query = "
CREATE TABLE IF NOT EXISTS myprefix_myaddontable (
myuser_id INT UNSIGNED NOT NULL,
myaddondata VARCHAR(8) NOT NULL DEFAULT 'somedata',
PRIMARY KEY (myuser_id)
) ENGINE = InnoDB CHARACTER SET utf8 COLLATE utf8_general_ci
";

$db->query($query);

to delete a table:

$db = $this->_getDb();

$query = "
DROP TABLE IF EXISTS myprefix_myaddontable
";

$db->query($query);

If the above is not what you are referring please let me know.
 
in xenforo datawriters handle the cud (create, update, delete) operations and the model the read operations:)
 
Any idea why the segregation of read to Models and write to Datawriters other than catering to master-slave config for mysql?
 
Top Bottom