-
☆ A M B ☆
- 24,524 Posts
The "id" field actually only identifies the user in the "users" table; in all of the other user tables the "id" field refers to the record (which may or may not be in sync with the users table), so the actual user ID is stored as internalKey.
If you are doing whatever you are doing immediately after saving the user, I'm pretty sure there is a way of accessing the OnUserSave event in a snippet, or at least I'm pretty sure I've seen such a thing in code somewhere - in any case it provides an object of modUser with all the user data.
-
MODX Staff
- 10,725 Posts
First, I wouldn't bother with the transaction code; in order for the related object queries to work with transactions, PDO would have to support nested transactions, which I don't believe it does.
Second, as soon as you call save() on an xPDOObject, the primary key is populated on the object. You do not need to do anything but access the primary key field( s ) as you normally would.
-
☆ A M B ☆
- 24,524 Posts