This repository was archived by the owner on Sep 16, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +23
-13
lines changed Expand file tree Collapse file tree 5 files changed +23
-13
lines changed Original file line number Diff line number Diff line change 1
1
Changelog
2
2
=========
3
3
4
+ 1.2.x
5
+ -----
6
+
7
+ * ** 2014-05-21** : [ BC BREAK when extending BaseMenuNode] addChild and
8
+ removeChild now accepts every Knp\Menu\NodeInterface instead of only
9
+ MenuNode.
10
+
4
11
1.1.1
5
12
-----
6
13
Original file line number Diff line number Diff line change 12
12
namespace Symfony \Cmf \Bundle \MenuBundle \Doctrine \Phpcr ;
13
13
14
14
use Doctrine \ODM \PHPCR \HierarchyInterface ;
15
+ use Knp \Menu \NodeInterface ;
15
16
use Symfony \Cmf \Bundle \MenuBundle \Model \Menu as ModelMenu ;
16
- use Symfony \Cmf \Bundle \MenuBundle \Model \MenuNode as ModelMenuNode ;
17
17
18
18
class Menu extends ModelMenu implements HierarchyInterface
19
19
{
@@ -58,11 +58,11 @@ public function setPosition($parent, $name)
58
58
/**
59
59
* Add a child menu node, automatically setting the parent node.
60
60
*
61
- * @param ModelMenuNode $child
61
+ * @param NodeInterface $child
62
62
*
63
- * @return ModelMenuNode - The newly added child node.
63
+ * @return NodeInterface - The newly added child node.
64
64
*/
65
- public function addChild (ModelMenuNode $ child )
65
+ public function addChild (NodeInterface $ child )
66
66
{
67
67
if ($ child instanceof MenuNode) {
68
68
$ child ->setParentObject ($ this );
Original file line number Diff line number Diff line change 12
12
namespace Symfony \Cmf \Bundle \MenuBundle \Doctrine \Phpcr ;
13
13
14
14
use Doctrine \ODM \PHPCR \HierarchyInterface ;
15
+ use Knp \Menu \NodeInterface ;
15
16
use Symfony \Cmf \Bundle \MenuBundle \Model \MenuNode as ModelMenuNode ;
16
17
17
18
class MenuNode extends ModelMenuNode implements HierarchyInterface
@@ -57,11 +58,11 @@ public function setPosition($parent, $name)
57
58
/**
58
59
* Add a child menu node, automatically setting the parent node.
59
60
*
60
- * @param ModelMenuNode $child
61
+ * @param NodeInterface $child
61
62
*
62
- * @return ModelMenuNode - The newly added child node.
63
+ * @return NodeInterface - The newly added child node.
63
64
*/
64
- public function addChild (ModelMenuNode $ child )
65
+ public function addChild (NodeInterface $ child )
65
66
{
66
67
if ($ child instanceof MenuNode) {
67
68
$ child ->setParentObject ($ this );
Original file line number Diff line number Diff line change @@ -365,11 +365,11 @@ public function getChildren()
365
365
/**
366
366
* Add a child menu node under this node.
367
367
*
368
- * @param MenuNode $child
368
+ * @param NodeInterface $child
369
369
*
370
- * @return MenuNode The newly added child node.
370
+ * @return NodeInterface The newly added child node.
371
371
*/
372
- public function addChild (MenuNode $ child )
372
+ public function addChild (NodeInterface $ child )
373
373
{
374
374
$ this ->children [] = $ child ;
375
375
@@ -379,13 +379,15 @@ public function addChild(MenuNode $child)
379
379
/**
380
380
* Remove a child menu node
381
381
*
382
- * @param MenuNode $child
382
+ * @param NodeInterface $child
383
383
*
384
384
* @return MenuNodeBase $this
385
385
*/
386
- public function removeChild (MenuNode $ child )
386
+ public function removeChild (NodeInterface $ child )
387
387
{
388
388
$ this ->children ->removeElement ($ child );
389
+
390
+ return $ this ;
389
391
}
390
392
391
393
/**
Original file line number Diff line number Diff line change 38
38
"target-dir" : " Symfony/Cmf/Bundle/MenuBundle" ,
39
39
"extra" : {
40
40
"branch-alias" : {
41
- "dev-master" : " 1.1 -dev"
41
+ "dev-master" : " 1.2 -dev"
42
42
}
43
43
}
44
44
}
You can’t perform that action at this time.
0 commit comments