added another schema example with onDelete: CASCADE
generalized a connection example to use user:pass instead of jwage:pass...
This commit is contained in:
parent
c456e4c788
commit
64e1f6e44a
@ -108,10 +108,40 @@ GroupUser:
|
|||||||
primary: true
|
primary: true
|
||||||
</code>
|
</code>
|
||||||
|
|
||||||
|
+++ One to One Aggregate
|
||||||
|
|
||||||
|
<code type="yaml">
|
||||||
|
---
|
||||||
|
User:
|
||||||
|
columns:
|
||||||
|
id:
|
||||||
|
type: integer(4)
|
||||||
|
primary: true
|
||||||
|
autoincrement: true
|
||||||
|
contact_id:
|
||||||
|
type: integer(4)
|
||||||
|
username:
|
||||||
|
type: string(255)
|
||||||
|
password:
|
||||||
|
type: string(255)
|
||||||
|
relations:
|
||||||
|
Contact:
|
||||||
|
foreignType: one
|
||||||
|
onDelete: CASCADE
|
||||||
|
Contact:
|
||||||
|
columns:
|
||||||
|
id:
|
||||||
|
type: integer(4)
|
||||||
|
primary: true
|
||||||
|
autoincrement: true
|
||||||
|
name:
|
||||||
|
type: string(255)
|
||||||
|
</code>
|
||||||
|
|
||||||
++ Connection Binding
|
++ Connection Binding
|
||||||
|
|
||||||
<code type="php">
|
<code type="php">
|
||||||
Doctrine::connection('mysql://jwage:pass@localhost/connection1', 'connection1');
|
Doctrine::connection('mysql://user:pass@localhost/connection1', 'connection1');
|
||||||
</code>
|
</code>
|
||||||
|
|
||||||
<code type="yaml">
|
<code type="yaml">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user