Skip to content

Commit

Permalink
Merge pull request omeka#1489 from Daniel-KM/feature/return_value
Browse files Browse the repository at this point in the history
Returned an array when fetching all values when there is no result.
  • Loading branch information
zerocrates authored Mar 8, 2020
2 parents feffb49 + 2d27f84 commit c2d2447
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public function values()
* - all: (false) If true, returns all values that match criteria. If false,
* returns the first matching value.
* - default: (null) Default value if no values match criteria. Returns null
* by default.
* by default for single result, empty array for all results.
* - lang: (null) Get values of this language only. Returns values of all
* languages by default.
* @return ValueRepresentation|ValueRepresentation[]|mixed
Expand All @@ -328,7 +328,7 @@ public function value($term, array $options = [])
$options['all'] = false;
}
if (!isset($options['default'])) {
$options['default'] = null;
$options['default'] = $options['all'] ? [] : null;
}
if (!isset($options['lang'])) {
$options['lang'] = null;
Expand Down

0 comments on commit c2d2447

Please sign in to comment.