diff --git a/manual/docs/Object relational mapping - Relations - Foreign key associations - One-to-Many, Many-to-One.php b/manual/docs/Object relational mapping - Relations - Foreign key associations - One-to-Many, Many-to-One.php index 90796e250..0f85f8b99 100644 --- a/manual/docs/Object relational mapping - Relations - Foreign key associations - One-to-Many, Many-to-One.php +++ b/manual/docs/Object relational mapping - Relations - Foreign key associations - One-to-Many, Many-to-One.php @@ -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); diff --git a/manual/docs/Object relational mapping - Relations - Foreign key associations - One-to-One.php b/manual/docs/Object relational mapping - Relations - Foreign key associations - One-to-One.php index c919e275a..35614e4bb 100644 --- a/manual/docs/Object relational mapping - Relations - Foreign key associations - One-to-One.php +++ b/manual/docs/Object relational mapping - Relations - Foreign key associations - One-to-One.php @@ -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'); } -} +} diff --git a/manual/docs/Object relational mapping - Relations - Foreign key constraints - Constraint actions.php b/manual/docs/Object relational mapping - Relations - Foreign key constraints - Constraint actions.php index 1992b19f7..48314a010 100644 --- a/manual/docs/Object relational mapping - Relations - Foreign key constraints - Constraint actions.php +++ b/manual/docs/Object relational mapping - Relations - Foreign key constraints - Constraint actions.php @@ -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. -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');