- typo fixes
This commit is contained in:
parent
16a2370e27
commit
a8fb6cde01
@ -4,7 +4,7 @@ class User extends Doctrine_Record {
|
||||
public function setUp() {
|
||||
$this->ownsMany('Phonenumber','Phonenumber.user_id');
|
||||
}
|
||||
public function setTableDefition() {
|
||||
public function setTableDefinition() {
|
||||
$this->hasColumn('name','string',50);
|
||||
$this->hasColumn('loginname','string',20);
|
||||
$this->hasColumn('password','string',16);
|
||||
|
@ -4,7 +4,7 @@ The relationship between user and address is one-to-one aggregate.
|
||||
|
||||
|
||||
|
||||
The Email component here is mapped to User component's column email_id hence their relation is called LOCALKEY relation.
|
||||
The Email component here is mapped to User component's column email_id hence their relation is called LOCALKEY relation.
|
||||
On the other hand the Address component is mapped to User by it's user_id column hence the relation between User and Address is called
|
||||
FOREIGNKEY relation.
|
||||
|
||||
@ -15,7 +15,7 @@ class User extends Doctrine_Record {
|
||||
$this->ownsOne('Email','User.email_id');
|
||||
$this->ownsMany('Phonenumber','Phonenumber.user_id');
|
||||
}
|
||||
public function setTableDefition() {
|
||||
public function setTableDefinition() {
|
||||
$this->hasColumn('name','string',50);
|
||||
$this->hasColumn('loginname','string',20);
|
||||
$this->hasColumn('password','string',16);
|
||||
@ -29,10 +29,10 @@ class Email extends Doctrine_Record {
|
||||
$this->hasColumn('address','string',150);
|
||||
}
|
||||
}
|
||||
class Address extends Doctrine_Record {
|
||||
class Address extends Doctrine_Record {
|
||||
public function setTableDefinition() {
|
||||
$this->hasColumn('street','string',50);
|
||||
$this->hasColumn('user_id','integer');
|
||||
}
|
||||
}
|
||||
}
|
||||
</code>
|
||||
|
@ -4,10 +4,10 @@ Delete or update the row from the parent table and automatically delete or updat
|
||||
//SET NULL// :
|
||||
Delete or update the row from the parent table and set the foreign key column or columns in the child table to NULL. This is valid only if the foreign key columns do not have the NOT NULL qualifier specified. Both ON DELETE SET NULL and ON UPDATE SET NULL clauses are supported.
|
||||
|
||||
//NO ACTION// :
|
||||
//NO ACTION// :
|
||||
In standard SQL, NO ACTION means no action in the sense that an attempt to delete or update a primary key value is not allowed to proceed if there is a related foreign key value in the referenced table.
|
||||
|
||||
//RESTRICT// :
|
||||
//RESTRICT// :
|
||||
Rejects the delete or update operation for the parent table. NO ACTION and RESTRICT are the same as omitting the ON DELETE or ON UPDATE clause.
|
||||
|
||||
//SET DEFAULT// :
|
||||
@ -15,22 +15,22 @@ Rejects the delete or update operation for the parent table. NO ACTION and RESTR
|
||||
In the following example we define two classes, User and Phonenumber with their relation being one-to-many. We also add a foreign key constraint with onDelete cascade action.
|
||||
|
||||
<code type='php'>
|
||||
class User extends Doctrine_Record
|
||||
class User extends Doctrine_Record
|
||||
{
|
||||
public function setUp()
|
||||
public function setUp()
|
||||
{
|
||||
$this->hasMany('Phonenumber', 'Phonenumber.user_id', array('onDelete' => 'cascade'));
|
||||
}
|
||||
public function setTableDefition()
|
||||
public function setTableDefinition()
|
||||
{
|
||||
$this->hasColumn('name', 'string', 50);
|
||||
$this->hasColumn('loginname', 'string', 20);
|
||||
$this->hasColumn('password', 'string', 16);
|
||||
}
|
||||
}
|
||||
class Phonenumber extends Doctrine_Record
|
||||
class Phonenumber extends Doctrine_Record
|
||||
{
|
||||
public function setTableDefinition()
|
||||
public function setTableDefinition()
|
||||
{
|
||||
$this->hasColumn('phonenumber', 'string', 50);
|
||||
$this->hasColumn('user_id', 'integer');
|
||||
|
Loading…
x
Reference in New Issue
Block a user