|
2 | 2 | Metadata
|
3 | 3 | ========
|
4 | 4 |
|
5 |
| -Because Doctrine entities dont extend any smart base class, we have to tell |
| 5 | +Because Doctrine entities do not extend any smart ancestor class, we have to tell |
6 | 6 | Doctrine how to map the data from the database into the entity. There are
|
7 | 7 | multiple ways of doing this.
|
8 | 8 |
|
@@ -65,26 +65,27 @@ App.Entities.Article.dcm.xml
|
65 | 65 |
|
66 | 66 | .. code-block:: xml
|
67 | 67 |
|
68 |
| -<?xml version="1.0" encoding="UTF-8"?> |
69 |
| -<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" |
70 |
| - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
71 |
| - xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping |
72 |
| - http://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd"> |
73 |
| - |
74 |
| - <entity name="App\Entities\Article" table="articles"> |
75 |
| - <id name="id" type="integer" column="id"> |
76 |
| - <generator strategy="AUTO"/> |
77 |
| - <sequence-generator sequence-name="tablename_seq" allocation-size="100" initial-value="1" /> |
78 |
| - </id> |
79 |
| - <field name="title" column="title" type="string" /> |
80 |
| - </entity> |
81 |
| -</doctrine-mapping> |
82 |
| -``` |
| 68 | + <?xml version="1.0" encoding="UTF-8"?> |
| 69 | + <doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" |
| 70 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 71 | + xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping |
| 72 | + http://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd"> |
| 73 | +
|
| 74 | + <entity name="App\Entities\Article" table="articles"> |
| 75 | + <id name="id" type="integer" column="id"> |
| 76 | + <generator strategy="AUTO"/> |
| 77 | + <sequence-generator sequence-name="tablename_seq" allocation-size="100" initial-value="1" /> |
| 78 | + </id> |
| 79 | + <field name="title" column="title" type="string" /> |
| 80 | + </entity> |
| 81 | + </doctrine-mapping> |
| 82 | +
|
83 | 83 |
|
84 | 84 | More information about XML mappings:
|
85 | 85 | https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/xml-mapping.html
|
86 | 86 |
|
87 |
| -### Config files |
| 87 | +Config files |
| 88 | +------------ |
88 | 89 |
|
89 | 90 | This package adds another option, which leverages Laravel's config system.
|
90 | 91 | In addition to setting `meta`, this also requires setting `mapping_file`.
|
|
0 commit comments