From 8f172869f59e2fe70ec5b2525c2807b665b18d6c Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Sat, 27 Feb 2016 23:33:03 +0100 Subject: [PATCH] add changelog notice and cleanup phpdoc --- CHANGELOG.md | 6 ++++++ Enhancer/ContentRepositoryEnhancer.php | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a0dd1a9..1338052b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 --------- diff --git a/Enhancer/ContentRepositoryEnhancer.php b/Enhancer/ContentRepositoryEnhancer.php index 16f7fef5..bd29ac08 100644 --- a/Enhancer/ContentRepositoryEnhancer.php +++ b/Enhancer/ContentRepositoryEnhancer.php @@ -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; @@ -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,