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
854051e1
Commit
854051e1
authored
Jan 12, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
couple of more changes
parent
50c98904
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
NestedSet.php
draft/Tree/NestedSet.php
+6
-6
No files found.
draft/Tree/NestedSet.php
View file @
854051e1
...
...
@@ -90,13 +90,13 @@ class Doctrine_Tree_NestedSet extends Doctrine_Tree implements Doctrine_Tree_Int
*
* @return object $record instance of Doctrine_Record
*/
public
function
findRoot
(
$root
_i
d
=
1
)
public
function
findRoot
(
$root
I
d
=
1
)
{
$q
=
$this
->
table
->
createQuery
();
$q
=
$q
->
where
(
'lft = ?'
,
1
);
// if tree has many roots, then specify root id
$q
=
$this
->
returnQueryWithRootId
(
$q
,
$root
_i
d
);
$q
=
$this
->
returnQueryWithRootId
(
$q
,
$root
I
d
);
$root
=
$q
->
execute
()
->
getFirst
();
...
...
@@ -126,8 +126,8 @@ class Doctrine_Tree_NestedSet extends Doctrine_Tree implements Doctrine_Tree_Int
->
orderBy
(
'lft asc'
);
// if tree has many roots, then specify root id
$root
_i
d
=
isset
(
$options
[
'root_id'
])
?
$options
[
'root_id'
]
:
'1'
;
$q
=
$this
->
returnQueryWithRootId
(
$q
,
$root
_i
d
);
$root
I
d
=
isset
(
$options
[
'root_id'
])
?
$options
[
'root_id'
]
:
'1'
;
$q
=
$this
->
returnQueryWithRootId
(
$q
,
$root
I
d
);
$tree
=
$q
->
execute
();
...
...
@@ -230,10 +230,10 @@ class Doctrine_Tree_NestedSet extends Doctrine_Tree implements Doctrine_Tree_Int
* @param integer $root_id id of destination root
* @return object Doctrine_Query
*/
public
function
returnQueryWithRootId
(
$query
,
$root
_i
d
=
1
)
public
function
returnQueryWithRootId
(
$query
,
$root
I
d
=
1
)
{
if
(
$this
->
getAttribute
(
'has_many_roots'
))
{
$query
->
addWhere
(
$this
->
getAttribute
(
'root_column_name'
)
.
' = ?'
,
$root
_i
d
);
$query
->
addWhere
(
$this
->
getAttribute
(
'root_column_name'
)
.
' = ?'
,
$root
I
d
);
}
return
$query
;
...
...
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