This repository was archived by the owner on Sep 16, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +28
-26
lines changed Expand file tree Collapse file tree 4 files changed +28
-26
lines changed Original file line number Diff line number Diff line change 18
18
use Symfony \Component \DependencyInjection \Loader \XmlFileLoader ;
19
19
use Symfony \Component \DependencyInjection \Definition ;
20
20
use Symfony \Component \DependencyInjection \Reference ;
21
+ use Symfony \Component \DependencyInjection \Extension \PrependExtensionInterface ;
21
22
22
- class CmfResourceRestExtension extends Extension
23
+ class CmfResourceRestExtension extends Extension implements PrependExtensionInterface
23
24
{
25
+ public function prepend (ContainerBuilder $ container )
26
+ {
27
+ $ container ->prependExtensionConfig ('jms_serializer ' , array (
28
+ 'metadata ' => array (
29
+ 'directories ' => array (
30
+ array (
31
+ 'path ' => __DIR__ . '/../Resources/config/serializer ' ,
32
+ 'namespace_prefix ' => 'Symfony\Cmf\Component\Resource\Repository\Resource ' ,
33
+ ),
34
+ array (
35
+ 'path ' => __DIR__ . '/../Resources/config/serializer ' ,
36
+ 'namespace_prefix ' => 'Puli\Repository\Resource ' ,
37
+ ),
38
+ ),
39
+ ),
40
+ ));
41
+ }
42
+
24
43
/**
25
44
* {@inheritDoc}
26
45
*/
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <serializer >
3
+ <class name =" Puli\Repository\Resource\GenericResource" xmlns : h =" https://github.com/willdurand/Hateoas" >
4
+ <property name =" repo" exclude =" true" />
5
+ </class >
6
+ </serializer >
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" UTF-8" ?>
2
2
<serializer >
3
- <class name =" Symfony\Cmf\Component\Resource\Repository\Resource\PhpcrOdmResource" exclusion-policy = " ALL " exclude = " true " >
3
+ <class name =" Symfony\Cmf\Component\Resource\Repository\Resource\PhpcrOdmResource" xmlns : h = " https://github.com/willdurand/Hateoas " >
4
4
<h : relation rel =" self" >
5
5
<h : href route =" _cmf_resource" >
6
6
<h : parameter name =" repositoryName" value =" testrepo" />
7
7
<h : parameter name =" path" value =" expr(object.getPath())" />
8
8
</h : href >
9
9
</h : relation >
10
- <h : relation rel =" children" >
11
- <h : embedded >
12
- <h : content >expr(object.listChildren())</h : content >
13
- </h : embedded >
14
- </h : relation >
10
+ <virtual-property serialized-name =" children" max-depth =" 1" method =" listChildren" />
15
11
</class >
16
12
</serializer >
You can’t perform that action at this time.
0 commit comments