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

Using DataWriter to Add to Database

Discussion in 'XenForo Development Discussions' started by James, Aug 4, 2011.

  1. James

    James Well-Known Member

    When doing:
    It gives me an error "the field newField was not recognised".

    I'm guessing this error is because my new field isn't present in the _getFields() function in XenForo_DataWriter_User.

    Assuming the above is correct: How would I go about adding my new field to the _getFields() function? Would I just extend it, call parent::_getFields() and then array_merge my new field to it? Or is there a more "proper" method?

    Assuming the above is wrong: Correct me :D

    Note: All I want to do is modify a new field in the xf_user table.

    UPDATE: Managed it by appending to the xf_user array.

Share This Page