Jarves\Storage\Propel::getPropelPk PHP Method

getPropelPk() public method

Since the core provide the pk as array('id' => 123) and not as array(123) we have to convert it for propel orm.
public getPropelPk ( array $pk, string $objectKey = null ) : mixed
$pk array
$objectKey string
return mixed Propel PK
    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;
    }