$id =& $scriptProperties['userid'];
$corePath = $modx->getOption('core_path', $properties, MODX_CORE_PATH);
$model_path = $corePath.'components/members/model/';
$modx->addPackage('members',$model_path);
$memberUser = $modx->getObject('memberUser', $id);
$memberUser->remove();
[2010-04-02 04:36:24] (ERROR @ /connectors/security/user.php) Could not get table name for class: modAccess
[2010-04-02 04:36:24] (ERROR @ /connectors/security/user.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` = 93' at line 1
)
<object class="memberUser" extends="modUser"> <composite alias="MemberApplication" class="memberApplication" local="id" foreign="internalKey" cardinality="one" owner="local" /> <composite alias="MemberSkillGroups" class="memberSkillGroup" local="id" foreign="internalKey" cardinality="many" owner="local" /> <composite alias="MemberProfessions" class="memberProfession" local="id" foreign="userId" cardinality="many" owner="local" /> <composite alias="MemberLinks" class="memberLink" local="id" foreign="internalKey" cardinality="many" owner="local" /> <composite alias="MemberResidencies" class="memberResidence" local="id" foreign="internalKey" cardinality="many" owner="local" /> <composite alias="MemberContactInfos" class="memberContactInfo" local="id" foreign="internalKey" cardinality="many" owner="local" /> <composite alias="MemberLanguages" class="memberLanguage" local="id" foreign="internalKey" cardinality="many" owner="local" /> </object>
<aggregate alias="User" class="memberUser" local="internalKey" foreign="id" cardinality="one" owner="foreign" />
Yeah, I think this is simply an internal bug that is related to the access control systems when extending modUser, and should not be affecting anything.
<?php
function __construct(& $xpdo) {
parent::__construct($xpdo);
$this->set('class_key', 'memberUser');
}
?><?php
$userObj = $modx->getObject('modUser', $someId);
if ($userObj instanceof memberClass && $userObj->getOne('MemberApplication')) {
var_dump($userObj->MemberApplication->toArray());
}
?>package:path
modx.user.crowd:{core_path}model/modx.user.foo:{core_path}model;bobs.userpkg:{core_path}components/bobs/model/a) be in the same table with the appropriate class_keymemberUser never had it’s own table, so that’s not a problem.
If existing packages are specified in extension_packages, they are separated with a semi-colon, e.g.
$memberSchemaDef = '{"Profile":{},"MemberApplication":{},"MemberLinks":{},"MemberResidencies":{},"MemberContactInfos":{},"MemberLanguages":{},"MemberSkillGroups":{}}';
$memberUser = $modx->getObjectGraph('modUser', $memberSchemaDef , $myQuery);I tried to forget you windows people, but alas, you reminded me.
If existing packages are specified in extension_packages, they are separated with a semi-colon, e.g.
Breaking my head and then looking at modx.class.php I realized:
a. I think you mean it should be separated by comma, and not semi-colon (line 378)
b. there’s a bug in line 381 affecting windows hosts, it should be:
$exploded= explode(’:’, $extPackage,2);
otherwise addPackage doesn’t happen (don’t forget we windows people have the c:/ in the start...)
should i jira this?
Please enter a ticket; I’ll have to modify this code to handle such, but not sure adding the limit of 2 will do it if you have multiple extension packages. Regardless, we can sort it out.What does $myQuery look like?
My current issue I’m on is that this does not work with the *Graph methods.
I get only the modUser composite (like Profile) and not my own.
$memberSchemaDef = '{"Profile":{},"MemberApplication":{},"MemberLinks":{},"MemberResidencies":{},"MemberContactInfos":{},"MemberLanguages":{},"MemberSkillGroups":{}}'; $memberUser = $modx->getObjectGraph('modUser', $memberSchemaDef , $myQuery);