Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
4e9f8bd5
Commit
4e9f8bd5
authored
Aug 26, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed example of transactional operations in AR guide
parent
dd61be67
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
db-active-record.md
docs/guide/db-active-record.md
+10
-6
No files found.
docs/guide/db-active-record.md
View file @
4e9f8bd5
...
...
@@ -969,12 +969,16 @@ as described in "transactions" section of "[Database basics](db-dao.md)". Anothe
```
php
class
Post
extends
\yii\db\ActiveRecord
{
return
[
'admin'
=>
self
::
OP_INSERT
,
'api'
=>
self
::
OP_INSERT
|
self
::
OP_UPDATE
|
self
::
OP_DELETE
,
// the above is equivalent to the following:
// 'api' => self::OP_ALL,
];
public
function
transactions
()
{
return
[
'admin'
=>
self
::
OP_INSERT
,
'api'
=>
self
::
OP_INSERT
|
self
::
OP_UPDATE
|
self
::
OP_DELETE
,
// the above is equivalent to the following:
// 'api' => self::OP_ALL,
];
}
}
```
In the above
`admin`
and
`api`
are model scenarios and constants starting with
`OP_`
are operations that should
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment