Skip to content

Commit

Permalink
Coding standards
Browse files Browse the repository at this point in the history
  • Loading branch information
dannylamb committed Dec 30, 2019
1 parent 12dfcf7 commit f8dd584
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions src/IslandoraUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,12 @@ public function getUriForTerm(TermInterface $term) {
return NULL;
}

/**
* Gets every field name that might contain an external uri for a term.
*
* @return string[]
* Field names for fields that a term may have as an external uri.
*/
public function getUriFieldNamesForTerms() {
// Get authority link fields to search.
$field_map = $this->entityFieldManager->getFieldMap();
Expand Down
9 changes: 6 additions & 3 deletions src/Plugin/Condition/NodeHasTerm.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta
return parent::buildConfigurationForm($form, $form_state);
}

/**
* {@inheritdoc}
*/
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
parent::validateConfigurationForm($form, $form_state);
$value = $form_state->getValue('term');
Expand Down Expand Up @@ -199,17 +202,17 @@ protected function evaluateEntity(EntityInterface $entity) {
}

foreach ($field_names as $field_name) {
if ($entity->hasField($field_name) && !$entity->get($field_name)->isEmpty()) {
if ($entity->hasField($field_name) && !$entity->get($field_name)->isEmpty()) {
return TRUE;
}
}
}
return FALSE;
});

// Get their URIs.
$haystack = array_map(function ($term) {
return $this->utils->getUriForTerm($term);
},
},
$terms
);

Expand Down

0 comments on commit f8dd584

Please sign in to comment.