I’ve got a similar need. Is this possible??
<object class="Eventcomps" table="eventcomps" extends="xPDOObject">
<field key="id_comp" dbtype="int" precision="9" phptype="integer" null="false" index="pk" generated="native" />
<field key="compid_comp" dbtype="int" precision="11" phptype="integer" null="true" />
<field key="eid_comp" dbtype="int" precision="9" phptype="integer" null="false" index="index" />
<aggregate alias="Resource" class="modResource" local="eid_comp" foreign="id" cardinality="one" owner="foreign" />
</object>
44+ MODXed sites and counting...
-
☆ A M B ☆
- 3,141 Posts
Yes; you can extend modResource.
No; I’ve never done it or things to think about and as it’s such a vital part of what’s going on in the Manager I sort of didn’t try it

All I know is that there’s a system setting called "custom_resource_classes" and that I’m pretty sure you’ll need to add your custom class there, I’m guessing in JSON format which specifies the model path and class name at least.
I *think* you’ll end up having to create your own new/update controllers when using a custom modResource class in which I would personally go for the simple solution: hook a plugin into on(Before)DocFormDelete / onEmptyTrash and do some logic checking in that.