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
419daa81
Commit
419daa81
authored
Sep 20, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small refactorings
parent
9b951928
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
25 deletions
+21
-25
Connection.php
Doctrine/Connection.php
+20
-24
UnitOfWork.php
Doctrine/Connection/UnitOfWork.php
+1
-1
No files found.
Doctrine/Connection.php
View file @
419daa81
...
@@ -204,6 +204,9 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
...
@@ -204,6 +204,9 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
return
count
(
$this
->
tables
);
return
count
(
$this
->
tables
);
}
}
/**
/**
* addTable
* adds a Doctrine_Table object into connection registry
*
* @param $objTable a Doctrine_Table object to be added into registry
* @param $objTable a Doctrine_Table object to be added into registry
* @return boolean
* @return boolean
*/
*/
...
@@ -217,6 +220,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
...
@@ -217,6 +220,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
return
true
;
return
true
;
}
}
/**
/**
* create
* creates a record
* creates a record
*
*
* create creates a record
* create creates a record
...
@@ -240,7 +244,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
...
@@ -240,7 +244,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
}
}
/**
/**
* saveAll
* saveAll
*
save
s all the records from all tables
*
persist
s all the records from all tables
*
*
* @return void
* @return void
*/
*/
...
@@ -274,6 +278,9 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
...
@@ -274,6 +278,9 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
}
}
}
}
/**
/**
* evictTables
* evicts all tables
*
* @return void
* @return void
*/
*/
public
function
evictTables
()
{
public
function
evictTables
()
{
...
@@ -424,16 +431,10 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
...
@@ -424,16 +431,10 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
$foreign
=
$fk
->
getForeign
();
$foreign
=
$fk
->
getForeign
();
if
(
$record
->
getTable
()
->
hasPrimaryKey
(
$fk
->
getLocal
()))
{
if
(
$record
->
getTable
()
->
hasPrimaryKey
(
$fk
->
getLocal
()))
{
switch
(
$record
->
getState
())
:
if
(
!
$record
->
exists
())
case
Doctrine_Record
::
STATE_TDIRTY
:
case
Doctrine_Record
::
STATE_TCLEAN
:
$saveLater
[
$k
]
=
$fk
;
$saveLater
[
$k
]
=
$fk
;
break
;
else
case
Doctrine_Record
::
STATE_CLEAN
:
case
Doctrine_Record
::
STATE_DIRTY
:
$v
->
save
();
$v
->
save
();
break
;
endswitch
;
}
else
{
}
else
{
// ONE-TO-ONE relationship
// ONE-TO-ONE relationship
$obj
=
$record
->
get
(
$fk
->
getTable
()
->
getComponentName
());
$obj
=
$record
->
get
(
$fk
->
getTable
()
->
getComponentName
());
...
@@ -552,10 +553,9 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
...
@@ -552,10 +553,9 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
* @return boolean true on success, false on failure
* @return boolean true on success, false on failure
*/
*/
final
public
function
delete
(
Doctrine_Record
$record
)
{
final
public
function
delete
(
Doctrine_Record
$record
)
{
switch
(
$record
->
getState
())
:
if
(
!
$record
->
exists
())
case
Doctrine_Record
::
STATE_PROXY
:
return
false
;
case
Doctrine_Record
::
STATE_CLEAN
:
case
Doctrine_Record
::
STATE_DIRTY
:
$this
->
beginTransaction
();
$this
->
beginTransaction
();
$this
->
deleteComposites
(
$record
);
$this
->
deleteComposites
(
$record
);
...
@@ -563,10 +563,6 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
...
@@ -563,10 +563,6 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
$this
->
commit
();
$this
->
commit
();
return
true
;
return
true
;
break
;
default
:
return
false
;
endswitch
;
}
}
/**
/**
* returns a string representation of this object
* returns a string representation of this object
...
...
Doctrine/Connection/UnitOfWork.php
View file @
419daa81
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
*/
*/
/**
/**
* Doctrine_
Transaction
* Doctrine_
Connection_UnitOfWork
*
*
* @package Doctrine ORM
* @package Doctrine ORM
* @url www.phpdoctrine.com
* @url www.phpdoctrine.com
...
...
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