File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 11Changelog
22=========
33
4+ 1.4.0
5+ -----
6+
7+ * ** 2016-02-27** : Added ContentRepositoryEnhancer that can look up a content by
8+ ID from a content repository.
9+
4101.4.0-RC1
511---------
612
Original file line number Diff line number Diff line change 1616use Symfony \Component \HttpFoundation \Request ;
1717
1818/**
19- * This enhancer sets the content to target field if the route has content id.
19+ * This enhancer uses a ContentRepositoryInterface to load a content if $target
20+ * is empty.
2021 *
21- * Works with ContentRepositoryInterface that you can search the content.
22+ * $source specifies the field that contains the ID to load, $target specifies
23+ * the field where to put the content returned by the repository.
2224 *
2325 * @author Samusev Andrey
2426 */
2527class ContentRepositoryEnhancer implements RouteEnhancerInterface
2628{
2729 /**
28- * @var Repository
30+ * @var ContentRepositoryInterface
2931 */
3032 private $ contentRepository ;
3133
@@ -42,7 +44,7 @@ class ContentRepositoryEnhancer implements RouteEnhancerInterface
4244 /**
4345 * @param ContentRepositoryInterface $contentRepository repository to search for the content
4446 * @param string $target the field name to set content
45- * @param string $source the field name of the content id
47+ * @param string $source the field name of the request parameter that contains the id
4648 */
4749 public function __construct (
4850 ContentRepositoryInterface $ contentRepository ,
You can’t perform that action at this time.
0 commit comments