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 1
1
Changelog
2
2
=========
3
3
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
+
4
10
1.4.0-RC1
5
11
---------
6
12
Original file line number Diff line number Diff line change 16
16
use Symfony \Component \HttpFoundation \Request ;
17
17
18
18
/**
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.
20
21
*
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.
22
24
*
23
25
* @author Samusev Andrey
24
26
*/
25
27
class ContentRepositoryEnhancer implements RouteEnhancerInterface
26
28
{
27
29
/**
28
- * @var Repository
30
+ * @var ContentRepositoryInterface
29
31
*/
30
32
private $ contentRepository ;
31
33
@@ -42,7 +44,7 @@ class ContentRepositoryEnhancer implements RouteEnhancerInterface
42
44
/**
43
45
* @param ContentRepositoryInterface $contentRepository repository to search for the content
44
46
* @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
46
48
*/
47
49
public function __construct (
48
50
ContentRepositoryInterface $ contentRepository ,
You can’t perform that action at this time.
0 commit comments