public function getPropelPk($pk, $objectKey = null)
{
$definition = $this->getDefinition();
if ($objectKey) {
$definition = $this->objects->getDefinition($objectKey);
}
$result = [];
foreach ($definition->getPrimaryKeyNames() as $primaryKey) {
if (isset($pk[$primaryKey])) {
$result[] = $pk[$primaryKey];
}
}
if ($definition->getWorkspace()) {
$result[] = isset($pk['workspaceId']) ? $pk['workspaceId'] : WorkspaceManager::getCurrent();
}
return 1 === count($result) ? $result[0] : $result;
}