Skip to content
Permalink
Browse files

Merge pull request #204 from lauradjhernando/master

Use configured identifier instead of hardcoded guid
  • Loading branch information
flack committed Jan 14, 2020
2 parents 93620dd + aa145ea commit 83c3c3f7ec1182a85d3897957297fd4874aa8a09
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/midcom/datamanager/storage/dbacollection.php
@@ -89,9 +89,11 @@ public function load()
$result = [];
$qb = midcom::get()->dbfactory->new_query_builder($this->config['type_config']['mapping_class_name']);
$qb->add_constraint($this->config['type_config']['master_fieldname'], '=', $this->get_master_foreign_key());

$identifier = $this->config['type_config']['master_is_id'] ? 'id' : 'guid';

foreach ($qb->execute() as $object) {
$result[$object->guid] = new dbacontainer($this->schema, $object, []);
$result[$object->$identifier] = new dbacontainer($this->schema, $object, []);
}

return $result;

0 comments on commit 83c3c3f

Please sign in to comment.
You can’t perform that action at this time.