We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26503
    • 620 Posts
    ok - I've extended modUser & for the most part it seems to be running pretty smoothly.

    However~ when a use is deleted using the manager, their extUser data is not deleted as well.

    Is this supposed to happen, or do I need to write a plugin to make that happen.

    [I thought once the schema was written, extended & the user's class keys were changed that this should automatically happen!]

    This question has been answered by m.engel. See the first response.

      *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

      Sean Kimball CLP, CLS.
      Technical Director / Sr. Developer | BigBlock Studios
      ._______________________________________________.
      Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
      27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
      phone/fax: 905-426-5525
    • discuss.answer
      • 40706
      • 128 Posts
      Do you use an composite Relationship to the extended Table? Only those are removed with the primary record.
        • 26503
        • 620 Posts
        I thought I did! I think UserData is supposed to be composite [there can only be one set of user data]


        <?xml version="1.0" encoding="UTF-8"?>

        <model package="extuser" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.1" >

        <object class="ExtUser" extends="modUser">
        <composite alias="UserData" local="id" class="UserData" foreign="internalKey" cardinality="one" owner="local" />
        <composite alias="UserQueries" local="id" class="UserQueries" foreign="internalKey" cardinality="many" owner="local" />
        </object>

        <object class="UserData" table="user_ext_data" extends="xPDOSimpleObject">
        <field key="internalKey" dbtype="int" precision="10" phptype="integer" null="true" />
        <field key="market" dbtype="varchar" precision="50" phptype="string" null="true" />
        <field key="skype" dbtype="varchar" precision="255" phptype="string" null="true" />
        <field key="livechat" dbtype="varchar" precision="255" phptype="string" null="true" />
        <field key="firstlogin" dbtype="int" precision="11" phptype="integer" null="true" />
        <aggregate alias="ExtUser" local="internalKey" foreign="id" cardinality="one" owner="foreign" />
        </object>

        <object class="UserQueries" table="user_queries" extends="xPDOSimpleObject">
        <field key="internalKey" dbtype="int" precision="10" phptype="integer" null="false" />
        <field key="date" dbtype="time" phptype="string" null="false" />
        <field key="query" dbtype="longtext" phptype="string" null="false" />
        <aggregate alias="ExtUser" local="internalKey" foreign="id" cardinality="one" owner="foreign" />
        </object>

        </model>


        Quote from: m.engel at Jul 25, 2014, 01:59 PM
        Do you use an composite Relationship to the extended Table? Only those are removed with the primary record.
          *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

          Sean Kimball CLP, CLS.
          Technical Director / Sr. Developer | BigBlock Studios
          ._______________________________________________.
          Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
          27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
          phone/fax: 905-426-5525
          • 26503
          • 620 Posts
          Thanks - I changed the relationship on the UserData table to a composite & now it works as expected smiley
            *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

            Sean Kimball CLP, CLS.
            Technical Director / Sr. Developer | BigBlock Studios
            ._______________________________________________.
            Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
            27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
            phone/fax: 905-426-5525