We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37099
    • 338 Posts
    I've created a custom table, each record in the table is associated with one modx Resource

    Eg in the schema I have
    <aggregate alias="Resource" class="modResource" local="resourceId" foreign="id" cardinality="one" owner="foreign"/>
    


    Is it possible to set it up so that when a Resource is deleted all the associated records in the custom table are deleted too?

    Thanks
    Mike

      • 4172
      • 5,888 Posts
      A plugin on the event onResourceDelete could do that.

      Another way could be to have a custom-resource-class with
      a composite-relation to your table
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 37099
        • 338 Posts
        Bruno to the rescue again smiley

        A plugin, of course!

        That sounds the easiest option for me.

        Would there be any advantages with a custom-resource-class?
        (Though I don't know how to implement one at this stage)

        Thanks
        Mike