Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Tomáš Trávníček
doctrine-dbal
Commits
6daa1e34
Commit
6daa1e34
authored
Nov 16, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed references to deprecated getTransaction() and getUnitOfWork() methods
parent
4f361df6
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
130 deletions
+47
-130
Configurable.php
lib/Doctrine/Configurable.php
+3
-3
Record.php
lib/Doctrine/Record.php
+3
-3
ConnectionTestCase.php
tests/ConnectionTestCase.php
+33
-121
UnitTestCase.php
tests/UnitTestCase.php
+2
-1
run.php
tests/run.php
+6
-2
No files found.
lib/Doctrine/Configurable.php
View file @
6daa1e34
...
...
@@ -47,7 +47,7 @@ abstract class Doctrine_Configurable {
*
* <code>
* $manager->setAttribute(Doctrine::ATTR_PORTABILITY, Doctrine::PORTABILITY_ALL);
*
*
* // or
*
* $manager->setAttribute('portability', Doctrine::PORTABILITY_ALL);
...
...
@@ -76,12 +76,12 @@ abstract class Doctrine_Configurable {
break
;
case
Doctrine
::
ATTR_LOCKMODE
:
if
(
$this
instanceof
Doctrine_Connection
)
{
if
(
$this
->
getTransaction
()
->
getState
()
!=
Doctrine_Connection_Transaction
::
STATE_OPEN
)
if
(
$this
->
transaction
->
getState
()
!=
Doctrine_Connection_Transaction
::
STATE_OPEN
)
throw
new
Doctrine_Exception
(
"Couldn't set lockmode. There are transactions open."
);
}
elseif
(
$this
instanceof
Doctrine_Manager
)
{
foreach
(
$this
as
$connection
)
{
if
(
$connection
->
getTransaction
()
->
getState
()
!=
Doctrine_Connection_Transaction
::
STATE_OPEN
)
if
(
$connection
->
transaction
->
getState
()
!=
Doctrine_Connection_Transaction
::
STATE_OPEN
)
throw
new
Doctrine_Exception
(
"Couldn't set lockmode. There are transactions open."
);
}
}
else
{
...
...
lib/Doctrine/Record.php
View file @
6daa1e34
...
...
@@ -864,12 +864,12 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
$conn
->
beginTransaction
();
$saveLater
=
$conn
->
getUnitOfWork
()
->
saveRelated
(
$this
);
$saveLater
=
$conn
->
unitOfWork
->
saveRelated
(
$this
);
if
(
$this
->
isValid
())
{
$conn
->
save
(
$this
);
}
else
{
$conn
->
getTransaction
()
->
addInvalid
(
$this
);
$conn
->
transaction
->
addInvalid
(
$this
);
}
foreach
(
$saveLater
as
$fk
)
{
...
...
@@ -884,7 +884,7 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
// save the MANY-TO-MANY associations
$conn
->
getUnitOfWork
()
->
saveAssociations
(
$this
);
$conn
->
unitOfWork
->
saveAssociations
(
$this
);
//$this->saveAssociations();
$conn
->
commit
();
...
...
tests/ConnectionTestCase.php
View file @
6daa1e34
This diff is collapsed.
Click to expand it.
tests/UnitTestCase.php
View file @
6daa1e34
...
...
@@ -30,6 +30,7 @@ class Doctrine_UnitTestCase extends UnitTestCase {
protected
$users
;
protected
$valueHolder
;
protected
$tables
=
array
();
protected
$unitOfWork
;
private
$init
=
false
;
...
...
@@ -79,7 +80,7 @@ class Doctrine_UnitTestCase extends UnitTestCase {
$this
->
listener
=
new
Doctrine_EventListener_Debugger
();
$this
->
manager
->
setAttribute
(
Doctrine
::
ATTR_LISTENER
,
$this
->
listener
);
}
$this
->
unitOfWork
=
$this
->
connection
->
unitOfWork
;
$this
->
connection
->
setListener
(
new
Doctrine_EventListener
());
$this
->
query
=
new
Doctrine_Query
(
$this
->
connection
);
$this
->
prepareTables
();
...
...
tests/run.php
View file @
6daa1e34
...
...
@@ -43,6 +43,8 @@ require_once('QueryShortAliasesTestCase.php');
require_once
(
'QueryDeleteTestCase.php'
);
require_once
(
'QueryUpdateTestCase.php'
);
require_once
(
'UnitOfWorkTestCase.php'
);
require_once
(
'RelationAccessTestCase.php'
);
require_once
(
'RelationTestCase.php'
);
require_once
(
'RelationManyToManyTestCase.php'
);
...
...
@@ -67,6 +69,10 @@ print '<pre>';
$test
=
new
GroupTest
(
'Doctrine Framework Unit Tests'
);
$test
->
addTestCase
(
new
Doctrine_UnitOfWork_TestCase
());
$test
->
addTestCase
(
new
Doctrine_ConnectionTestCase
());
$test
->
addTestCase
(
new
Doctrine_Db_TestCase
());
$test
->
addTestCase
(
new
Doctrine_Db_Profiler_TestCase
());
...
...
@@ -75,8 +81,6 @@ $test->addTestCase(new Doctrine_Query_MultiJoin_TestCase());
$test
->
addTestCase
(
new
Doctrine_Record_TestCase
());
$test
->
addTestCase
(
new
Doctrine_ConnectionTestCase
());
$test
->
addTestCase
(
new
Doctrine_DataDict_Pgsql_TestCase
());
$test
->
addTestCase
(
new
Doctrine_Relation_ManyToMany_TestCase
());
...
...
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