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
944e1fc0
Commit
944e1fc0
authored
May 13, 2013
by
resurtm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
isOpAtomic → isOperationAtomic
parent
60140706
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
ActiveRecord.php
yii/db/ActiveRecord.php
+4
-4
No files found.
yii/db/ActiveRecord.php
View file @
944e1fc0
...
@@ -688,7 +688,7 @@ class ActiveRecord extends Model
...
@@ -688,7 +688,7 @@ class ActiveRecord extends Model
return
false
;
return
false
;
}
}
$db
=
static
::
getDb
();
$db
=
static
::
getDb
();
$transaction
=
$this
->
isOpAtomic
(
self
::
OP_INSERT
)
&&
$db
->
getTransaction
()
===
null
?
$db
->
beginTransaction
()
:
null
;
$transaction
=
$this
->
isOp
eration
Atomic
(
self
::
OP_INSERT
)
&&
$db
->
getTransaction
()
===
null
?
$db
->
beginTransaction
()
:
null
;
try
{
try
{
$result
=
$this
->
insertInternal
(
$attributes
);
$result
=
$this
->
insertInternal
(
$attributes
);
if
(
$transaction
!==
null
)
{
if
(
$transaction
!==
null
)
{
...
@@ -798,7 +798,7 @@ class ActiveRecord extends Model
...
@@ -798,7 +798,7 @@ class ActiveRecord extends Model
return
false
;
return
false
;
}
}
$db
=
static
::
getDb
();
$db
=
static
::
getDb
();
$transaction
=
$this
->
isOpAtomic
(
self
::
OP_UPDATE
)
&&
$db
->
getTransaction
()
===
null
?
$db
->
beginTransaction
()
:
null
;
$transaction
=
$this
->
isOp
eration
Atomic
(
self
::
OP_UPDATE
)
&&
$db
->
getTransaction
()
===
null
?
$db
->
beginTransaction
()
:
null
;
try
{
try
{
$result
=
$this
->
updateInternal
(
$attributes
);
$result
=
$this
->
updateInternal
(
$attributes
);
if
(
$transaction
!==
null
)
{
if
(
$transaction
!==
null
)
{
...
@@ -905,7 +905,7 @@ class ActiveRecord extends Model
...
@@ -905,7 +905,7 @@ class ActiveRecord extends Model
public
function
delete
()
public
function
delete
()
{
{
$db
=
static
::
getDb
();
$db
=
static
::
getDb
();
$transaction
=
$this
->
isOpAtomic
(
self
::
OP_DELETE
)
&&
$db
->
getTransaction
()
===
null
?
$db
->
beginTransaction
()
:
null
;
$transaction
=
$this
->
isOp
eration
Atomic
(
self
::
OP_DELETE
)
&&
$db
->
getTransaction
()
===
null
?
$db
->
beginTransaction
()
:
null
;
try
{
try
{
$result
=
false
;
$result
=
false
;
if
(
$this
->
beforeDelete
())
{
if
(
$this
->
beforeDelete
())
{
...
@@ -1431,7 +1431,7 @@ class ActiveRecord extends Model
...
@@ -1431,7 +1431,7 @@ class ActiveRecord extends Model
* @param string $op possible values are ActiveRecord::INSERT, ActiveRecord::UPDATE and ActiveRecord::DELETE.
* @param string $op possible values are ActiveRecord::INSERT, ActiveRecord::UPDATE and ActiveRecord::DELETE.
* @return boolean whether given operation is atomic. Currently active scenario is taken into account.
* @return boolean whether given operation is atomic. Currently active scenario is taken into account.
*/
*/
private
function
isOpAtomic
(
$op
)
private
function
isOp
eration
Atomic
(
$op
)
{
{
$scenario
=
$this
->
getScenario
();
$scenario
=
$this
->
getScenario
();
$scenarios
=
$this
->
scenarios
();
$scenarios
=
$this
->
scenarios
();
...
...
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