Commit 60140706 by resurtm

AR atomic scenarios internals doc fix.

parent 35688b32
...@@ -10,25 +10,13 @@ All possible scenario formats supported by ActiveRecord: ...@@ -10,25 +10,13 @@ All possible scenario formats supported by ActiveRecord:
public function scenarios() public function scenarios()
{ {
return array( return array(
// 1. attributes array // attributes array, all operations won't be wrapped with transaction
'scenario1' => array('attribute1', 'attribute2'), 'scenario1' => array('attribute1', 'attribute2'),
// 2. insert, update and delete operations won't be wrapped with transaction (default mode) // insert and update operations will be wrapped with transaction, delete won't be wrapped
'scenario2' => array( 'scenario2' => array(
'attributes' => array('attribute1', 'attribute2'), 'attributes' => array('attribute1', 'attribute2'),
'atomic' => array(), // default value 'atomic' => array(self::OP_INSERT, self::OP_UPDATE),
),
// 3. insert and update operations will be wrapped with transaction, delete won't be wrapped
'scenario4' => array(
'attributes' => array('attribute1', 'attribute2'),
'atomic' => array(self::OPERATION_INSERT, self::OPERATION_UPDATE),
),
// 5. insert and update operations won't be wrapped with transaction, delete will be wrapped
'scenario5' => array(
'attributes' => array('attribute1', 'attribute2'),
'atomic' => array(self::OPERATION_DELETE),
), ),
); );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment