1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

modeling a data table

Discussion in 'General PHP and MySQL Discussions' started by Sebastian, May 6, 2012.

  1. Sebastian

    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!
  2. Lawrence

    Lawrence Well-Known Member

    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


    to delete a table:

    $db = $this->_getDb();

    $query = "
    DROP TABLE IF EXISTS myprefix_myaddontable


    If the above is not what you are referring please let me know.
  3. ragtek

    ragtek Guest

    in xenforo datawriters handle the cud (create, update, delete) operations and the model the read operations:)
  4. Hlchia

    Hlchia Active Member

    Any idea why the segregation of read to Models and write to Datawriters other than catering to master-slave config for mysql?

Share This Page