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
56a70884
Commit
56a70884
authored
Jul 25, 2009
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] Added missing detach cascade option.
parent
28ca2acb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
9 deletions
+18
-9
AssociationMapping.php
lib/Doctrine/ORM/Mapping/AssociationMapping.php
+13
-0
ClassMetadata.php
lib/Doctrine/ORM/Mapping/ClassMetadata.php
+2
-0
SqlWalker.php
lib/Doctrine/ORM/Query/SqlWalker.php
+3
-9
No files found.
lib/Doctrine/ORM/Mapping/AssociationMapping.php
View file @
56a70884
...
...
@@ -70,6 +70,7 @@ abstract class AssociationMapping
public
$isCascadePersist
;
public
$isCascadeRefresh
;
public
$isCascadeMerge
;
public
$isCascadeDetach
;
/**
* The fetch mode used for the association.
...
...
@@ -188,6 +189,7 @@ abstract class AssociationMapping
$this
->
isCascadePersist
=
in_array
(
'persist'
,
$this
->
cascades
);
$this
->
isCascadeRefresh
=
in_array
(
'refresh'
,
$this
->
cascades
);
$this
->
isCascadeMerge
=
in_array
(
'merge'
,
$this
->
cascades
);
$this
->
isCascadeDetach
=
in_array
(
'detach'
,
$this
->
cascades
);
}
/**
...
...
@@ -234,6 +236,17 @@ abstract class AssociationMapping
return
$this
->
isCascadeMerge
;
}
/**
* Whether the association cascades detach() operations from the source entity
* to the target entity/entities.
*
* @return boolean
*/
public
function
isCascadeDetach
()
{
return
$this
->
isCascadeDetach
;
}
/**
* Whether the target entity/entities of the association are eagerly fetched.
*
...
...
lib/Doctrine/ORM/Mapping/ClassMetadata.php
View file @
56a70884
...
...
@@ -26,6 +26,8 @@ use Doctrine\Common\DoctrineException;
/**
* A <tt>ClassMetadata</tt> instance holds all the ORM metadata of an entity and
* it's associations. It is the backbone of Doctrine's metadata mapping.
*
* Once populated, ClassMetadata instances are usually cached in a serialized form.
*
* <b>IMPORTANT NOTE:</b>
*
...
...
lib/Doctrine/ORM/Query/SqlWalker.php
View file @
56a70884
...
...
@@ -474,6 +474,9 @@ class SqlWalker implements TreeWalker
}
// Append foreign keys if necessary.
//FIXME: Evaluate HINT_INCLUDE_META_COLUMNS
//FIXME: Needs to be done in the case of Class Table Inheritance, too
// (see upper block of the if/else)
if
(
!
$this
->
_em
->
getConfiguration
()
->
getAllowPartialObjects
()
&&
!
$this
->
_query
->
getHint
(
Query
::
HINT_FORCE_PARTIAL_LOAD
))
{
foreach
(
$class
->
associationMappings
as
$assoc
)
{
...
...
@@ -1003,7 +1006,6 @@ class SqlWalker implements TreeWalker
if
(
$literal
instanceof
AST\InputParameter
)
{
$dqlParamKey
=
$literal
->
isNamed
()
?
$literal
->
getName
()
:
$literal
->
getPosition
();
$this
->
_parserResult
->
addParameterMapping
(
$dqlParamKey
,
$this
->
_sqlParamIndex
++
);
//return ($literal->isNamed() ? ':' . $literal->getName() : '?');
return
'?'
;
}
else
{
return
$literal
;
//TODO: quote() ?
...
...
@@ -1045,7 +1047,6 @@ class SqlWalker implements TreeWalker
$inputParam
=
$likeExpr
->
getStringPattern
();
$dqlParamKey
=
$inputParam
->
isNamed
()
?
$inputParam
->
getName
()
:
$inputParam
->
getPosition
();
$this
->
_parserResult
->
addParameterMapping
(
$dqlParamKey
,
$this
->
_sqlParamIndex
++
);
//$sql .= $inputParam->isNamed() ? ':' . $inputParam->getName() : '?';
$sql
.=
'?'
;
}
else
{
$sql
.=
$this
->
_conn
->
quote
(
$likeExpr
->
getStringPattern
());
...
...
@@ -1172,7 +1173,6 @@ class SqlWalker implements TreeWalker
if
(
is_numeric
(
$primary
))
{
$sql
.=
$primary
;
//TODO: quote() ?
}
else
if
(
is_string
(
$primary
))
{
//TODO: quote string according to platform
$sql
.=
$this
->
_conn
->
quote
(
$primary
);
}
else
if
(
$primary
instanceof
AST\SimpleArithmeticExpression
)
{
$sql
.=
'('
.
$this
->
walkSimpleArithmeticExpression
(
$primary
)
.
')'
;
...
...
@@ -1212,12 +1212,6 @@ class SqlWalker implements TreeWalker
$qComp
=
$this
->
_queryComponents
[
$dqlAlias
];
$class
=
$qComp
[
'metadata'
];
/*if ($numParts > 2) {
for ($i = 1; $i < $numParts-1; ++$i) {
//TODO
}
}*/
if
(
$this
->
_useSqlTableAliases
)
{
if
(
$class
->
isInheritanceTypeJoined
()
&&
isset
(
$class
->
fieldMappings
[
$fieldName
][
'inherited'
]))
{
$sql
.=
$this
->
getSqlTableAlias
(
$this
->
_em
->
getClassMetadata
(
...
...
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