Hi All
Have slight issue related to a custom db i have created, i have a one to many relationship set up using migxdb and everything is working fine.
So i have my CMP, i have both tables hooked up together in a relationship so that if i call the object->remove() in a snippet for that package it removes the primary entry and all of its related items in the related table.
the issue i have is that i want to replicate this functionality in the MIGXdb CMP so then if i mark something for deletion and then “empty trash” it will then remove those entries and the related objects in its related table. Is there some “hook” or block of code i can put somewhere in the migx config setup to trigger on empty trash to trigger the related items to be removed also as per the schema.
many thanks in advance
<object class="Assessments" table="assessments" extends="xPDOSimpleObject">
<field key="user_id" dbtype="int" phptype="integer" precision="10" null="false" default="" />
<field key="lifestyle" dbtype="decimal" precision="7,3" phptype="float" null="false" default="0" />
<field key="body" dbtype="decimal" precision="7,3" phptype="float" null="false" default="0" />
<field key="mind" dbtype="decimal" precision="7,3" phptype="float" null="false" default="0" />
<field key="about" dbtype="decimal" precision="7,3" phptype="float" null="false" default="0" />
<field key="status" dbtype="int" phptype="integer" precision="10" null="false" default="0" />
<field key="deleted" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0" />
<composite alias="answers" class="AssessAnswers" local="id" foreign="assessment_id" cardinality="many" owner="local" />
</object>
<object class="AssessAnswers" table="assessmentAnswers" extends="xPDOSimpleObject">
<field key="assessment_id" dbtype="int" phptype="integer" precision="10" null="false" default="" />
<field key="question_id" dbtype="int" phptype="integer" precision="10" null="false" default="" />
<field key="answer_id" dbtype="varchar" precision="128" phptype="string" null="false" default="0" />
<field key="answer" dbtype="varchar" precision="256" phptype="string" null="false" default="0" />
<field key="deleted" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0" />
<aggregate alias="assessment" class="Assessments" local="assessment_id" foreign="id" cardinality="one" owner="foreign" />
</object>
Schema is above if that helps but i know the schema is working due to the functionality of remove objects from a snippet working as expected