We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 50227
    • 18 Posts
    Hi All,

    I'm sure this must be straight forward if you know what you're doing...................

    I've successfully installed ClassExtender and it works GREAT - what I want to do now is to link in my own custom tables - the scenario is that a registered user will create Tutors and Pupils, The Tutors will create Charts that the Pupils will complete etc Tutors->Pupils->Charts->ChartData. What I've decided to try is to write the schema for my tables which are already set up and "working" then add that into the extendeduser package schema, then use BobRay's custom table reverse engineering script to generate the class files etc. Makes perfect sense to me but will it work.............. don't want to try it blind and mess things up so I'd appreciate your opinions/advice???

    |-)
      • 3749
      • 24,544 Posts
      I'm not quite sure what you mean. You can use the script to create class and map files for your other custom tables. You need to run the script first with &createClasses=`0`. That will create the schema. Then you need to edit the schema to add the relationships between the objects, because the script has no way of knowing about those.

      Then you need to run the script again with

      &createSchema=`0`
      &createClasses=`1`

      so it won't overwrite your schema and will create the class and map files.

      That will prepare your other custom tables for use with xPDO. I'm not sure what you mean, though, about integrating that with ClassExtender. The two techniques aren't really related. ClassExtender's elements won't know anything about the new stuff, so they won't put the new fields on the user form or save them to the DB for you.

      There's no reason I know of why you couldn't use ClassExtender *and* use xPDO with your other custom tables, but they will be independent operations.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 50227
        • 18 Posts
        Thanks for the reply BobRay - It made sense when I wrote it ;-)

        What I would like to happen is that I have an extended field in moduser to hold a custom userstatus which I can manipulate from the manager form and then have my custom tables linked to moduser via userid so that if a user is deleted it would cascade delete down through my custom tables.

        Having slept on it I now realise that it would be much easier to just have a plugin that is fired on OnUserRemove that cascade deletes down through my custom tables to remove all their associated data.

        I'm sure I know what I mean smiley

          • 3749
          • 24,544 Posts
          That makes sense to me. It sounds like a good plan. smiley
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting