You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/ip_traceable.md
+39-45Lines changed: 39 additions & 45 deletions
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,13 @@
1
1
# IpTraceable behavior extension for Doctrine
2
2
3
3
**IpTraceable** behavior will automate the update of IP trace
4
-
on your Entities or Documents. It works through annotations and can update
4
+
on your Entities or Documents. It works through annotations or attributes and can update
5
5
fields on creation, update, property subset update, or even on specific property value change.
6
6
7
-
This is very similar to Timestampable but sets a string.
7
+
This is very similar to the Timestampable behavior.
8
8
9
9
Note that you need to set the IP on the IpTraceableListener (unless you use the
10
-
Symfony extension which does automatically assign the current request IP).
11
-
10
+
Symfony bundle which automatically assigns the current request IP).
12
11
13
12
Features:
14
13
@@ -17,16 +16,16 @@ Features:
17
16
- Specific attributes and annotations for properties, and no interface required
18
17
- Can react to specific property or relation changes to specific value
19
18
- Can be nested with other behaviors
20
-
- Attribute, Annotation and Xml mapping support for extensions
19
+
- Attribute, Annotation and XML mapping support for extensions
21
20
22
-
This article will cover the basic installation and functionality of **IpTraceable** behavior
21
+
This article will cover the basic installation and functionality of the **IpTraceable** behavior
23
22
24
23
Content:
25
24
26
25
-[Including](#including-extension) the extension
27
26
- Entity [example](#entity-mapping)
28
27
- Document [example](#document-mapping)
29
-
-[Xml](#xml-mapping) mapping example
28
+
-[XML](#xml-mapping) mapping example
30
29
- Advanced usage [examples](#advanced-examples)
31
30
- Using [Traits](#traits)
32
31
@@ -36,7 +35,7 @@ Content:
36
35
37
36
Read the [documentation](./annotations.md#em-setup)
38
37
or check the [example code](../example)
39
-
on how to setup and use the extensions in most optimized way.
38
+
on how to set up and use the extensions.
40
39
41
40
<aname="entity-mapping"></a>
42
41
@@ -58,11 +57,11 @@ should be updated
58
57
-**value** - only valid if **on="change"** is specified and the tracked field is a single field (not an array), if the tracked field has this **value**
59
58
then it updates the trace
60
59
61
-
**Note:**that IpTraceable interface is not necessary, except in cases there
62
-
you need to identify entity as being IpTraceable. The metadata is loaded only once then
63
-
cache is activated
60
+
**Note:**the IpTraceable interface is not necessary, except in cases where
61
+
you need to identify the object as being IpTraceable in your application.
62
+
The metadata is loaded only once when the cache is activated.
64
63
65
-
**Note:** these examples are using annotations and attributes for mapping, you should use
64
+
**Note:** these examples are using annotations and attributes for mapping, you should only use
66
65
one of them, not both.
67
66
68
67
Column is a string field:
@@ -91,7 +90,7 @@ class Article
91
90
private $id;
92
91
93
92
/**
94
-
* * @var string|null
93
+
* @var string|null
95
94
* @ORM\Column(type="string", length=128)
96
95
*/
97
96
#[ORM\Column(type: Types::STRING, length: 128)]
@@ -256,7 +255,7 @@ Now on update and creation these annotated fields will be automatically updated
256
255
257
256
<aname="xml-mapping"></a>
258
257
259
-
## Xml mapping example
258
+
## XML mapping example
260
259
261
260
```xml
262
261
<?xml version="1.0" encoding="UTF-8"?>
@@ -268,13 +267,13 @@ Now on update and creation these annotated fields will be automatically updated
0 commit comments