forked from doctrine-extensions/DoctrineExtensions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix materialized getChildrenQueryBuilder method with includeNode set to
true.
- Loading branch information
Showing
3 changed files
with
199 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
tests/Gedmo/Tree/Fixture/MPCategoryWithTrimmedSeparator.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<?php | ||
|
||
namespace Tree\Fixture; | ||
|
||
use Gedmo\Tree\Node as NodeInterface; | ||
use Gedmo\Mapping\Annotation as Gedmo; | ||
use Doctrine\ORM\Mapping as ORM; | ||
|
||
/** | ||
* @ORM\Entity(repositoryClass="Gedmo\Tree\Entity\Repository\MaterializedPathRepository") | ||
* @Gedmo\Tree(type="materializedPath") | ||
*/ | ||
class MPCategoryWithTrimmedSeparator | ||
{ | ||
/** | ||
* @ORM\Column(name="id", type="integer") | ||
* @ORM\Id | ||
* @ORM\GeneratedValue | ||
*/ | ||
private $id; | ||
|
||
/** | ||
* @Gedmo\TreePath(appendId=false, startsWithSeparator=false, endsWithSeparator=false) | ||
* @ORM\Column(name="path", type="string", length=3000, nullable=true) | ||
*/ | ||
private $path; | ||
|
||
/** | ||
* @Gedmo\TreePathSource | ||
* @ORM\Column(name="title", type="string", length=64) | ||
*/ | ||
private $title; | ||
|
||
/** | ||
* @Gedmo\TreeParent | ||
* @ORM\ManyToOne(targetEntity="MPCategoryWithTrimmedSeparator", inversedBy="children") | ||
* @ORM\JoinColumns({ | ||
* @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="CASCADE") | ||
* }) | ||
*/ | ||
private $parentId; | ||
|
||
/** | ||
* @Gedmo\TreeLevel | ||
* @ORM\Column(name="lvl", type="integer", nullable=true) | ||
*/ | ||
private $level; | ||
|
||
/** | ||
* @ORM\OneToMany(targetEntity="MPCategoryWithTrimmedSeparator", mappedBy="parent") | ||
*/ | ||
private $children; | ||
|
||
public function getId() | ||
{ | ||
return $this->id; | ||
} | ||
|
||
public function setTitle($title) | ||
{ | ||
$this->title = $title; | ||
} | ||
|
||
public function getTitle() | ||
{ | ||
return $this->title; | ||
} | ||
|
||
public function setParent(MPCategoryWithTrimmedSeparator $parent = null) | ||
{ | ||
$this->parentId = $parent; | ||
} | ||
|
||
public function getParent() | ||
{ | ||
return $this->parentId; | ||
} | ||
|
||
public function setPath($path) | ||
{ | ||
$this->path = $path; | ||
} | ||
|
||
public function getPath() | ||
{ | ||
return $this->path; | ||
} | ||
|
||
public function getLevel() | ||
{ | ||
return $this->level; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters