Skip to content
Permalink
Browse files

Attempt to clarify behavior of dependent option.

Refs #8348
  • Loading branch information...
markstory committed Feb 26, 2016
1 parent 262ec6e commit 31ffabc662b89c68880c5fc5203db140c222c8c8
Showing with 10 additions and 6 deletions.
  1. +10 −6 src/ORM/Table.php
@@ -757,9 +757,10 @@ public function belongsTo($associated, array $options = [])
* - foreignKey: The name of the field to use as foreign key, if false none
* will be used
* - dependent: Set to true if you want CakePHP to cascade deletes to the
* associated table when an entity is removed on this table. Set to false
* if you don't want CakePHP to remove associated data, for when you are using
* database constraints.
* associated table when an entity is removed on this table. The delete operation
* on the associated table will not cascade further. To get recursive cascades enable
* `cascadeCallbacks` as well. Set to false if you don't want CakePHP to remove
* associated data, or when you are using database constraints.
* - cascadeCallbacks: Set to true if you want CakePHP to fire callbacks on
* cascaded deletes. If false the ORM will use deleteAll() to remove data.
* When true records will be loaded and then deleted.
@@ -799,9 +800,10 @@ public function hasOne($associated, array $options = [])
* - foreignKey: The name of the field to use as foreign key, if false none
* will be used
* - dependent: Set to true if you want CakePHP to cascade deletes to the
* associated table when an entity is removed on this table. Set to false
* if you don't want CakePHP to remove associated data, for when you are using
* database constraints.
* associated table when an entity is removed on this table. The delete operation
* on the associated table will not cascade further. To get recursive cascades enable
* `cascadeCallbacks` as well. Set to false if you don't want CakePHP to remove
* associated data, or when you are using database constraints.
* - cascadeCallbacks: Set to true if you want CakePHP to fire callbacks on
* cascaded deletes. If false the ORM will use deleteAll() to remove data.
* When true records will be loaded and then deleted.
@@ -850,6 +852,8 @@ public function hasMany($associated, array $options = [])
* - through: If you choose to use an already instantiated link table, set this
* key to a configured Table instance containing associations to both the source
* and target tables in this association.
* - dependent: Set to false, if you do not want junction table records removed
* when an owning record is removed.
* - cascadeCallbacks: Set to true if you want CakePHP to fire callbacks on
* cascaded deletes. If false the ORM will use deleteAll() to remove data.
* When true join/junction table records will be loaded and then deleted.

0 comments on commit 31ffabc

Please sign in to comment.
You can’t perform that action at this time.