-
-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow NodeMenuItem to be overridden without replacing the whole of No…
…deMenu
- Loading branch information
1 parent
c7681fe
commit b1cdb95
Showing
3 changed files
with
144 additions
and
12 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
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
120 changes: 120 additions & 0 deletions
120
src/Kunstmaan/NodeBundle/Helper/NodeMenuItemInterface.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,120 @@ | ||
<?php | ||
|
||
|
||
namespace Kunstmaan\NodeBundle\Helper; | ||
|
||
|
||
use Kunstmaan\NodeBundle\Entity\HasNodeInterface; | ||
use Kunstmaan\NodeBundle\Entity\Node; | ||
use Kunstmaan\NodeBundle\Entity\NodeTranslation; | ||
|
||
interface NodeMenuItemInterface | ||
{ | ||
/** | ||
* @param Node $node The node | ||
* @param NodeTranslation $nodeTranslation The nodetranslation | ||
* @param NodeMenuItem|null|false $parent The parent nodemenuitem | ||
* @param NodeMenu $menu The menu | ||
*/ | ||
public function __construct(Node $node, NodeTranslation $nodeTranslation, $parent = false, NodeMenu $menu); | ||
|
||
/** | ||
* @return int | ||
*/ | ||
public function getId(); | ||
|
||
/** | ||
* @return Node | ||
*/ | ||
public function getNode(); | ||
|
||
/** | ||
* @return NodeTranslation | ||
*/ | ||
public function getNodeTranslation(); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getTitle(); | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function getOnline(); | ||
|
||
/** | ||
* @return string|null | ||
*/ | ||
public function getSlugPart(); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getSlug(); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getUrl(); | ||
|
||
/** | ||
* @return NodeMenuItem|null | ||
*/ | ||
public function getParent(); | ||
|
||
/** | ||
* @param NodeMenuItem|null|false $parent | ||
*/ | ||
public function setParent($parent = false); | ||
|
||
/** | ||
* @param string $class | ||
* | ||
* @return NodeMenuItem|null | ||
*/ | ||
public function getParentOfClass($class); | ||
|
||
/** | ||
* @return NodeMenuItem[] | ||
*/ | ||
public function getParents(); | ||
|
||
/** | ||
* @param bool $includeHiddenFromNav Include hiddenFromNav nodes | ||
* | ||
* @return NodeMenuItem[] | ||
*/ | ||
public function getChildren($includeHiddenFromNav = true); | ||
|
||
/** | ||
* @param string $class | ||
* | ||
* @return NodeMenuItem[] | ||
*/ | ||
public function getChildrenOfClass($class); | ||
|
||
/** | ||
* Get the first child of class, this is not using the getChildrenOfClass method for performance reasons | ||
* | ||
* @param string $class | ||
* | ||
* @return NodeMenuItem | ||
*/ | ||
public function getChildOfClass($class); | ||
|
||
/** | ||
* @return HasNodeInterface | ||
*/ | ||
public function getPage(); | ||
|
||
/** | ||
* @return bool | ||
*/ | ||
public function getActive(); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getLang(); | ||
} |