Skip to content

Commit 396f421

Browse files
committed
Deprecate Yaml mapping
1 parent 908bcee commit 396f421

File tree

25 files changed

+32
-585
lines changed

25 files changed

+32
-585
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ a release.
4343
### Deprecated
4444
- Tree: When using Closure tree strategy, it is deprecated not defining the mapping associations of the closure entity.
4545
- `Gedmo\Tool\Logging\DBAL\QueryAnalizer` class without replacement.
46+
- Using YAML mapping is deprecated, you SHOULD migrate to attributes, annotations or XML.
4647

4748
### Changed
4849
- In order to use a custom cache for storing configuration of an extension, the user has to call `setCacheItemPool()`

doc/blameable.md

Lines changed: 1 addition & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Features:
2222
- Specific attributes and annotations for properties, and no interface required
2323
- Can react to specific property or relation changes to specific value
2424
- Can be nested with other behaviors
25-
- Attribute, Annotation, Yaml and Xml mapping support for extensions
25+
- Attribute, Annotation and Xml mapping support for extensions
2626

2727
This article will cover the basic installation and functionality of **Blameable** behavior
2828

@@ -31,7 +31,6 @@ Content:
3131
- [Including](#including-extension) the extension
3232
- Entity [example](#entity-mapping)
3333
- Document [example](#document-mapping)
34-
- [Yaml](#yaml-mapping) mapping example
3534
- [Xml](#xml-mapping) mapping example
3635
- Advanced usage [examples](#advanced-examples)
3736
- Using [Traits](#traits)
@@ -371,38 +370,6 @@ class Article
371370

372371
Now on update and creation these annotated fields will be automatically updated
373372

374-
<a name="yaml-mapping"></a>
375-
376-
## Yaml mapping example:
377-
378-
Yaml mapped Article: **/mapping/yaml/Entity.Article.dcm.yml**
379-
380-
```
381-
---
382-
Entity\Article:
383-
type: entity
384-
table: articles
385-
id:
386-
id:
387-
type: integer
388-
generator:
389-
strategy: AUTO
390-
fields:
391-
title:
392-
type: string
393-
length: 64
394-
createdBy:
395-
type: string
396-
gedmo:
397-
blameable:
398-
on: create
399-
updatedBy:
400-
type: string
401-
gedmo:
402-
blameable:
403-
on: update
404-
```
405-
406373
<a name="xml-mapping"></a>
407374

408375
## Xml mapping example
@@ -572,45 +539,6 @@ class Article
572539
}
573540
```
574541

575-
Yaml mapped Article: **/mapping/yaml/Entity.Article.dcm.yml**
576-
577-
```
578-
---
579-
Entity\Article:
580-
type: entity
581-
table: articles
582-
id:
583-
id:
584-
type: integer
585-
generator:
586-
strategy: AUTO
587-
fields:
588-
title:
589-
type: string
590-
length: 64
591-
createdBy:
592-
type: string
593-
gedmo:
594-
blameable:
595-
on: create
596-
updatedBy:
597-
type: string
598-
gedmo:
599-
blameable:
600-
on: update
601-
publishedBy:
602-
type: string
603-
gedmo:
604-
blameable:
605-
on: change
606-
field: type.title
607-
value: Published
608-
manyToOne:
609-
type:
610-
targetEntity: Entity\Type
611-
inversedBy: articles
612-
```
613-
614542
Now few operations to get it all done:
615543

616544
```php

doc/ip_traceable.md

Lines changed: 1 addition & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Features:
1717
- Specific attributes and annotations for properties, and no interface required
1818
- Can react to specific property or relation changes to specific value
1919
- Can be nested with other behaviors
20-
- Attribute, Annotation, Yaml and Xml mapping support for extensions
20+
- Attribute, Annotation and Xml mapping support for extensions
2121

2222
This article will cover the basic installation and functionality of **IpTraceable** behavior
2323

@@ -26,7 +26,6 @@ Content:
2626
- [Including](#including-extension) the extension
2727
- Entity [example](#entity-mapping)
2828
- Document [example](#document-mapping)
29-
- [Yaml](#yaml-mapping) mapping example
3029
- [Xml](#xml-mapping) mapping example
3130
- Advanced usage [examples](#advanced-examples)
3231
- Using [Traits](#traits)
@@ -255,42 +254,6 @@ class Article
255254

256255
Now on update and creation these annotated fields will be automatically updated
257256

258-
<a name="yaml-mapping"></a>
259-
260-
## Yaml mapping example:
261-
262-
Yaml mapped Article: **/mapping/yaml/Entity.Article.dcm.yml**
263-
264-
```
265-
---
266-
Entity\Article:
267-
type: entity
268-
table: articles
269-
id:
270-
id:
271-
type: integer
272-
generator:
273-
strategy: AUTO
274-
fields:
275-
title:
276-
type: string
277-
length: 64
278-
createdFromIp:
279-
type: string
280-
length: 45
281-
nullable: true
282-
gedmo:
283-
ipTraceable:
284-
on: create
285-
updatedFromIp:
286-
type: string
287-
length: 45
288-
nullable: true
289-
gedmo:
290-
ipTraceable:
291-
on: update
292-
```
293-
294257
<a name="xml-mapping"></a>
295258

296259
## Xml mapping example
@@ -460,51 +423,6 @@ class Article
460423
}
461424
```
462425

463-
Yaml mapped Article: **/mapping/yaml/Entity.Article.dcm.yml**
464-
465-
```
466-
---
467-
Entity\Article:
468-
type: entity
469-
table: articles
470-
id:
471-
id:
472-
type: integer
473-
generator:
474-
strategy: AUTO
475-
fields:
476-
title:
477-
type: string
478-
length: 64
479-
createdFromIp:
480-
type: string
481-
length: 45
482-
nullable: true
483-
gedmo:
484-
ipTraceable:
485-
on: create
486-
updatedFromIp:
487-
type: string
488-
length: 45
489-
nullable: true
490-
gedmo:
491-
ipTraceable:
492-
on: update
493-
publishedFromIp:
494-
type: string
495-
length: 45
496-
nullable: true
497-
gedmo:
498-
ipTraceable:
499-
on: change
500-
field: type.title
501-
value: Published
502-
manyToOne:
503-
type:
504-
targetEntity: Entity\Type
505-
inversedBy: articles
506-
```
507-
508426
Now few operations to get it all done:
509427

510428
```php

doc/loggable.md

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Features:
99
- ORM and ODM support using same listener
1010
- Can be nested with other behaviors
1111
- Objects can be reverted to previous versions
12-
- Attributes, Annotation, Yaml and Xml mapping support for extensions
12+
- Attributes, Annotation and Xml mapping support for extensions
1313

1414
This article will cover the basic installation and functionality of **Loggable**
1515
behavior
@@ -19,7 +19,6 @@ Content:
1919
- [Including](#including-extension) the extension
2020
- Entity [example](#entity-mapping)
2121
- Document [example](#document-mapping)
22-
- [Yaml](#yaml-mapping) mapping example
2322
- [Xml](#xml-mapping) mapping example
2423
- Basic usage [examples](#basic-examples)
2524

@@ -169,38 +168,6 @@ class Article
169168
}
170169
```
171170

172-
<a name="yaml-mapping"></a>
173-
174-
## Yaml mapping example
175-
176-
Yaml mapped Article: **/mapping/yaml/Entity.Article.dcm.yml**
177-
178-
```
179-
---
180-
Entity\Article:
181-
type: entity
182-
table: articles
183-
gedmo:
184-
loggable:
185-
# using specific personal LogEntryClass class:
186-
logEntryClass: My\LogEntry
187-
# without specifying the LogEntryClass class:
188-
# loggable: true
189-
id:
190-
id:
191-
type: integer
192-
generator:
193-
strategy: AUTO
194-
fields:
195-
title:
196-
type: string
197-
length: 64
198-
gedmo:
199-
- versioned
200-
content:
201-
type: text
202-
```
203-
204171
<a name="xml-mapping"></a>
205172

206173
## Xml mapping example

doc/mapping.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ for different object managers like **ODM** and **ORM**.
88

99
Features:
1010

11-
- Mapping drivers for annotation and yaml
11+
- Mapping drivers for annotation
1212
- Conventional extension points for metadata extraction and object manager abstraction
1313

1414
- Public [Mapping repository](https://github.com/doctrine-extensions/DoctrineExtensions "Mapping extension on Github") is available on github

doc/reference_integrity.md

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Reference Integrity behavior extension for Doctrine 2
22

33
**ReferenceIntegrity** behavior will automate the reference integrity for referenced documents.
4-
It works through annotations and yaml, and supports 'nullify', 'pull' and 'restrict' which throws an exception.
4+
It works through annotations and attributes, and supports 'nullify', 'pull' and 'restrict' which throws an exception.
55

66
So let's say you have a Type which is referenced to multiple Articles, when deleting the Type, by default the Article
77
would still have a reference to Type, since Mongo doesn't care. When setting the ReferenceIntegrity to 'nullify' it
@@ -15,15 +15,14 @@ Features:
1515
- ODM only
1616
- ReferenceOne and ReferenceMany support
1717
- 'nullify', 'pull' and 'restrict' support
18-
- Attribute, Annotation and Yaml mapping support for extensions
18+
- Attribute and Annotation mapping support for extensions
1919

2020
This article will cover the basic installation and functionality of **ReferenceIntegrity** behavior
2121

2222
Content:
2323

2424
- [Including](#including-extension) the extension
2525
- Document [example](#document-mapping)
26-
- [Yaml](#yaml-mapping) mapping example
2726
- Usage [examples](#advanced-examples)
2827

2928
<a name="including-extension"></a>
@@ -80,32 +79,6 @@ class Type
8079
It is necessary to have the 'mappedBy' option set, to be able to access the referenced documents.
8180
On removal of Type, on the referenced Article the Type reference will be nullified (removed)
8281

83-
<a name="yaml-mapping"></a>
84-
85-
## Yaml mapping example:
86-
87-
Yaml mapped Article: **/mapping/yaml/Documents.Article.dcm.yml**
88-
89-
```
90-
---
91-
Document\Type:
92-
type: document
93-
collection: types
94-
fields:
95-
id:
96-
id: true
97-
title:
98-
type: string
99-
article:
100-
reference: true
101-
type: one
102-
mappedBy: type
103-
targetDocument: Document\Article
104-
gedmo:
105-
referenceIntegrity: nullify # or pull or restrict
106-
107-
```
108-
10982
It is necessary to have the 'mappedBy' option set, to be able to access the referenced documents.
11083

11184
<a name="advanced-examples"></a>

0 commit comments

Comments
 (0)