Skip to content

Commit

Permalink
add changelog notice and cleanup phpdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Feb 27, 2016
1 parent fe6fb84 commit 8f17286
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

1.4.0
-----

* **2016-02-27**: Added ContentRepositoryEnhancer that can look up a content by
ID from a content repository.

1.4.0-RC1
---------

Expand Down
10 changes: 6 additions & 4 deletions Enhancer/ContentRepositoryEnhancer.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,18 @@
use Symfony\Component\HttpFoundation\Request;

/**
* This enhancer sets the content to target field if the route has content id.
* This enhancer uses a ContentRepositoryInterface to load a content if $target
* is empty.
*
* Works with ContentRepositoryInterface that you can search the content.
* $source specifies the field that contains the ID to load, $target specifies
* the field where to put the content returned by the repository.
*
* @author Samusev Andrey
*/
class ContentRepositoryEnhancer implements RouteEnhancerInterface
{
/**
* @var Repository
* @var ContentRepositoryInterface
*/
private $contentRepository;

Expand All @@ -42,7 +44,7 @@ class ContentRepositoryEnhancer implements RouteEnhancerInterface
/**
* @param ContentRepositoryInterface $contentRepository repository to search for the content
* @param string $target the field name to set content
* @param string $source the field name of the content id
* @param string $source the field name of the request parameter that contains the id
*/
public function __construct(
ContentRepositoryInterface $contentRepository,
Expand Down

0 comments on commit 8f17286

Please sign in to comment.