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
30521a70
Commit
30521a70
authored
Aug 14, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
1b8e9ea0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
15 deletions
+18
-15
Record.php
lib/Doctrine/Record.php
+18
-15
No files found.
lib/Doctrine/Record.php
View file @
30521a70
...
@@ -1434,10 +1434,12 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
...
@@ -1434,10 +1434,12 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
return
$this
;
return
$this
;
}
}
/**
/**
* removeLink
* removeLinks
* removes links from this record to given records
*
*
* @param string $alias
* @param string $alias related component alias
* @param array $ids
* @param array $ids the identifiers of the related records
* @return Doctrine_Record this object
*/
*/
public
function
removeLinks
(
$alias
,
$ids
)
public
function
removeLinks
(
$alias
,
$ids
)
{
{
...
@@ -1447,21 +1449,22 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
...
@@ -1447,21 +1449,22 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
$rel
=
$this
->
getTable
()
->
getRelation
(
$alias
);
$rel
=
$this
->
getTable
()
->
getRelation
(
$alias
);
$q
->
delete
()
if
(
$rel
instanceof
Doctrine_Relation_Association
)
{
->
from
(
$rel
->
getAssociationTable
()
->
getComponentName
())
$q
->
delete
()
->
where
(
$rel
->
getLocal
()
.
' = ?'
,
$this
->
identifier
())
->
from
(
$rel
->
getAssociationTable
()
->
getComponentName
())
->
whereIn
(
$rel
->
getForeign
(),
$ids
)
->
where
(
$rel
->
getLocal
()
.
' = ?'
,
$this
->
identifier
())
->
execute
();
->
whereIn
(
$rel
->
getForeign
(),
$ids
)
->
execute
();
if
(
isset
(
$this
->
references
[
$alias
]))
{
foreach
(
$this
->
references
[
$alias
]
as
$k
=>
$record
)
{
if
(
isset
(
$this
->
references
[
$alias
]))
{
if
(
in_array
(
$record
->
identifier
(),
$ids
))
{
foreach
(
$this
->
references
[
$alias
]
as
$k
=>
$record
)
{
$this
->
references
[
$alias
]
->
remove
(
$k
);
if
(
in_array
(
$record
->
identifier
(),
$ids
))
{
$this
->
references
[
$alias
]
->
remove
(
$k
);
}
}
}
$this
->
references
[
$alias
]
->
takeSnapshot
();
}
}
$this
->
references
[
$alias
]
->
takeSnapshot
();
}
}
return
$this
;
return
$this
;
}
}
/**
/**
...
...
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