Skip to content
Permalink
Browse files

Use configured identifier instead of hardcoded guid

  • Loading branch information
lauradjhernando committed Jan 14, 2020
1 parent 93620dd commit aa145ea9aac47195e5aa07383f897ebf47237b26
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 aa145ea

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