You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
ActiveRecord
|
|
|
|
============
|
|
|
|
|
|
|
|
Scenarios
|
|
|
|
---------
|
|
|
|
|
|
|
|
Possible scenario formats supported by ActiveRecord:
|
|
|
|
|
|
|
|
```php
|
|
|
|
public function scenarios()
|
|
|
|
{
|
|
|
|
return array(
|
|
|
|
// attributes array, all operations won't be wrapped with transaction
|
|
|
|
'scenario1' => array('attribute1', 'attribute2'),
|
|
|
|
|
|
|
|
// insert and update operations will be wrapped with transaction, delete won't be wrapped
|
|
|
|
'scenario2' => array(
|
|
|
|
'attributes' => array('attribute1', 'attribute2'),
|
|
|
|
'atomic' => array(self::OP_INSERT, self::OP_UPDATE),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
Query
|
|
|
|
-----
|
|
|
|
|
|
|
|
### Basic Queries
|
|
|
|
|
|
|
|
### Relational Queries
|
|
|
|
|
|
|
|
### Scopes
|