Skip to content

Commit

Permalink
Merge pull request #115 from ConductionNL/development
Browse files Browse the repository at this point in the history
Fix publication types on openregister
  • Loading branch information
rjzondervan authored Oct 19, 2024
2 parents 6448929 + ef4fbd6 commit 820087a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/Service/ObjectService.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,22 @@ public function __construct(
*/
private function getMapper(string $objectType): mixed
{
$objectTypeLower = strtolower($objectType);

// Get the source for the object type from the configuration
$source = $this->config->getValueString($this->appName, $objectType . '_source', 'internal');
$source = $this->config->getValueString($this->appName, $objectTypeLower . '_source', 'internal');

// If the source is 'open_registers', use the OpenRegister service
if ($source === 'openregister') {
$openRegister = $this->getOpenRegisters();
if ($openRegister === null) {
throw new Exception("OpenRegister service not available");
}
$register = $this->config->getValueString($this->appName, $objectType . '_register', '');
$register = $this->config->getValueString($this->appName, $objectTypeLower . '_register', '');
if (empty($register)) {
throw new Exception("Register not configured for $objectType");
}
$schema = $this->config->getValueString($this->appName, $objectType . '_schema', '');
$schema = $this->config->getValueString($this->appName, $objectTypeLower . '_schema', '');
if (empty($schema)) {
throw new Exception("Schema not configured for $objectType");
}
Expand Down

0 comments on commit 820087a

Please sign in to comment.