I have the following schema (partial):
<?xml version="1.0" encoding="UTF-8"?>
<model package="add" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.1">
<object class="extUser" extends="modUser">
<composite alias="ParentDetail" class="ParentDetails" local="id" foreign="parent_id" owner="local" cardinality="one" />
</object>
<object class="ParentDetails" table="parent_details" extends="xPDOSimpleObject">
<field key="parent_id" dbtype="int" precision="11" attributes="unsigned" phptype="integer" null="false" />
<field key="coach_id" dbtype="int" precision="11" attributes="unsigned" phptype="integer" null="false" />
<field key="hourly_rate" dbtype="int" precision="11" attributes="unsigned" phptype="integer" null="false" />
<aggregate alias="extUser" class="extUser" local="parent_id" foreign="id" cardinality="one" owner="foreign" />
</object>
</model>
A "parent" is a standard Modx user. When I delete the Modx user, I want the appropriate (one / one) record deleted from the parent_details table. This is not happening.
I think I know why after discovering this:
http://rtfm.modx.com/revolution/2.x/developing-in-modx/advanced-development/extending-moduser. After following this I tried to create a new user with a class key of extUser and got the error message:
Could not load class: extUser from mysql.extuser.
This is the value from the system setting
extension_packages :
[{"add":{"path":"[[++core_path]]components/add/model/","tablePrefix":"add_"}}]
This is the contents of core/components/add/model/add/extuser.class.php:
<?php
class extUser extends modUser {
function __construct(xPDO & $xpdo) {
parent::__construct($xpdo);
$this->set('class_key','extUser');
}
I seem to be missing something. Anyone know what?