$parentId = $modx->getParent($docId,1,'id');
(...) getParent() returns an array.
(...) you would use $parentId[’id’] to get the returned value.
The same way, if I want to list the IDs of a node’s published children documents in a vector, the value actually returned by getActiveChildren is a 2D array.
Then, to list the children IDs in a vector, I have to do this.
// Get available published and undeleted language nodes, sorted by menu index in ascending order.
$languagesById = $modx->getActiveChildren($root, 'menuindex', 'ASC','id'); // Get language IDs.
$i=-1;
foreach ($languagesById as $languageId) {
++$i;
$languagesById[$i] = $languagesById[$i]['id'];
}
print_r($languagesById);
Is there no easier way ?