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
a0def480
Commit
a0def480
authored
Feb 10, 2007
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added missing multiple root support to Doctrine_Node_NestedSet::getNextSibling()
and Doctrine_Node_NestedSet::getPrevSibling()
parent
e006ebb0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
NestedSet.php
lib/Doctrine/Node/NestedSet.php
+6
-2
No files found.
lib/Doctrine/Node/NestedSet.php
View file @
a0def480
...
...
@@ -79,7 +79,9 @@ class Doctrine_Node_NestedSet extends Doctrine_Node implements Doctrine_Node_Int
public
function
getPrevSibling
()
{
$q
=
$this
->
record
->
getTable
()
->
createQuery
();
$result
=
$q
->
where
(
'rgt = ?'
,
$this
->
getLeftValue
()
-
1
)
->
execute
()
->
getFirst
();
$q
=
$q
->
where
(
'rgt = ?'
,
$this
->
getLeftValue
()
-
1
);
$q
=
$this
->
record
->
getTable
()
->
getTree
()
->
returnQueryWithRootId
(
$q
,
$this
->
getRootValue
());
$result
=
$q
->
execute
()
->
getFirst
();
if
(
!
$result
)
$result
=
$this
->
record
->
getTable
()
->
create
();
...
...
@@ -95,7 +97,9 @@ class Doctrine_Node_NestedSet extends Doctrine_Node implements Doctrine_Node_Int
public
function
getNextSibling
()
{
$q
=
$this
->
record
->
getTable
()
->
createQuery
();
$result
=
$q
->
where
(
'lft = ?'
,
$this
->
getRightValue
()
+
1
)
->
execute
()
->
getFirst
();
$q
=
$q
->
where
(
'lft = ?'
,
$this
->
getRightValue
()
+
1
);
$q
=
$this
->
record
->
getTable
()
->
getTree
()
->
returnQueryWithRootId
(
$q
,
$this
->
getRootValue
());
$result
=
$q
->
execute
()
->
getFirst
();
if
(
!
$result
)
$result
=
$this
->
record
->
getTable
()
->
create
();
...
...
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