We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21120
    • 30 Posts
    I’m writing a class to hold additional user data. here’s the (simplified) schema:
    <?xml version="1.0" encoding="UTF-8"?>
    <model package="clientdetails" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" phpdoc-package="clientdetails" phpdoc-subpackage="model">
    	<object class="clientData" table="user_clients" extends="xPDOSimpleObject">
    		<field key="internalKey" dbtype="int" precision="10" phptype="integer" null="false" default="" attributes="unsigned" />
    		<field key="firstName" dbtype="varchar" precision="100" phptype="string" null="false" default="" />
    		<field key="lastName" dbtype="varchar" precision="100" phptype="string" null="false" default="" />
    		<aggregate alias="User" class="modUser" local="internalKey" foreign="id" cardinality="one" owner="foreign" />
    	</object>
    </model>


    When i remove a user, the related rows aren’t removed from my user_clients table. However, if i change the relationship to "composite" and delete the clientData row, then the user will be removed. But that’s not how i want this to function.

    Is the only way to get this to work correctly to add a relationship to the modx schema and rebuild it?? ...i hope not.

    I can’t figure out what i’m doing wrong (or if i’m doing anything wrong for that matter)

    -- neil
      • 21120
      • 30 Posts
      I realized i should probably check the error log.... This is what it says after i try to remove a user:

      [2010-09-14 12:28:13] (ERROR @ /index.php) Could not get table name for class: modAccess
      [2010-09-14 12:28:13] (ERROR @ /index.php) Error 42000 executing statement:
      Array
      (
      [0] => 42000
      [1] => 1064
      [2] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’AS `modAccess` WHERE `modAccess`.`principal` = 27’ at line 1
      )