Skip to content

Commit

Permalink
Merge pull request #4 from shopwareLabs/fixup-readme
Browse files Browse the repository at this point in the history
fixup readme
  • Loading branch information
JanPietrzyk authored Jul 24, 2017
2 parents c1e3e6e + 05dc5c9 commit 400f067
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ $writer->moveAsNextSibling('tree', 'root_id', 4, 7);
You may want to retrieve information about different nodes. This can be done through the `NestedSetTableNodeInspector`.

```php
$inspector = NestedSetFactory::createTableNodeInspector($connection, new NestedSetConfig('id', 'left', 'right', 'level'));
$inspector = NestedSetFactory::createTableNodeInspector($connection, $config);

$inspector->isLeaf('tree', 'root_id', 9); // true | false
$inspector->isAncestor('tree', 'root_id', 1, 2) // true | false
Expand All @@ -117,7 +117,7 @@ $inspector->isAncestor('tree', 'root_id', 1, 2) // true | false
The `NestedSetQueryFactory` helps retrieve a set of nodes from the tree. Since the library has no concept of entities it will only prepare query builders for you ready to add selects, joins and other conditions.

```php
$queryFactory = NestedSetFactory::createQueryFactory($connection, new NestedSetConfig('id', 'left', 'right', 'level'));
$queryFactory = NestedSetFactory::createQueryFactory($connection, $config);
$data = $queryFactory
->createChildrenQueryBuilder('tree', 't', 'root_id', 2)
->select('*')
Expand Down

0 comments on commit 400f067

Please sign in to comment.