Skip to content

Commit

Permalink
Avoid index collisions if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher committed Jul 30, 2020
1 parent 2e2a0f6 commit e659a78
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions classes/controlledVocab/ControlledVocabDAO.inc.php
Expand Up @@ -52,6 +52,10 @@ function getById($controlledVocabId) {
* @return $controlledVocab
*/
function _build($symbolic, $assocType = 0, $assocId = 0) {
// Attempt to fetch an existing controlled vocabulary.
$controlledVocab = $this->getBySymbolic($symbolic, $assocType, $assocId);
if ($controlledVocab) return $controlledVocab;

// Attempt to build a new controlled vocabulary.
$controlledVocab = $this->newDataObject();
$controlledVocab->setSymbolic($symbolic);
Expand Down

0 comments on commit e659a78

Please sign in to comment.