Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/74'
Browse files Browse the repository at this point in the history
Close #75
Fixes #74
  • Loading branch information
weierophinney committed Jul 27, 2016
2 parents 10b0978 + ddcc707 commit 8543f61
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## 1.2.2 - TBD
## 1.2.2 - 2016-07-27

### Added

Expand All @@ -18,7 +18,11 @@ All notable changes to this project will be documented in this file, in reverse

### Fixed

- Nothing.
- [#75](https://github.com/zfcampus/zf-content-negotiation/pull/75) updates the
`JsonModel` to test discovered `ZF\Hal\Entity` instances for a `getEntity()`
method; if found, that method will be used to pull the entity data, but if
not, property overloading to its `$entity` property will be used instead. This
change ensures the component works with versions of zf-hal prior to 1.4.

## 1.2.1 - 2016-07-07

Expand Down
4 changes: 3 additions & 1 deletion src/JsonModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ public function serialize()

// Use ZF\Hal\Entity's composed entity
if ($variables instanceof HalEntity) {
$variables = $variables->getEntity();
$variables = method_exists($variables, 'getEntity')
? $variables->getEntity() // v1.2+
: $variables->entity; // v1.0-1.1.*
}

// Use ZF\Hal\Collection's composed collection
Expand Down

0 comments on commit 8543f61

Please sign in to comment.