I have successfully extended modUser with a custom class and added a table with custom data. I can access the data as expected via a snippet on the front-end, however, I continue to get an error when loading the data to the manager form. It seems executing
$modx->addPackage('packagename','path/to/package/model');
fails when running in a custom class. The only way I can even create a new instance of my class is by first manually including the mysql class files. The error I am receiving when doing so is the following:
[2015-08-24 23:25:00] (ERROR @ /assets/components/dealerportalusers/connector.php) Could not get table name for class: Dpuserdata
[2015-08-24 23:25:00] (ERROR @ /assets/components/dealerportalusers/connector.php) No foreign key definition for parentClass: Dealerportaluser using relation alias: Dpuserdata
Is there some other way to load my class so I can create new records similar to the addProfile() method in the modUserCreateProcessor? Below is the addUserdata() method I have created that causes the errors. Any insights would be appreciated.
public function addUserdata() {
require_once MODX_CORE_PATH.'components/dealerportalusers/model/dealerportalusers/mysql/dpuserdata.class.php';
//$this->modx->addPackage('dealerportalusers',MODX_CORE_PATH.'components/dealerportalusers/model/');
$this->userdata = $this->modx->newObject('Dpuserdata');
$this->userdata->fromArray($this->getProperties());
$this->object->addOne($this->userdata,'Dpuserdata');
return $this->userdata;
}