-
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.
Add of disable breadcrumbs collection
- Loading branch information
Showing
12 changed files
with
260 additions
and
42 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?php | ||
|
||
namespace Jugid\AutomaticBreadcrumbs\Collection; | ||
|
||
use Jugid\AutomaticBreadcrumbs\Model\UrlBreadcrumb; | ||
|
||
/** | ||
* @author Julien Gidel <gidjulien@gmail.com> | ||
*/ | ||
class DisableBreadcrumbsCollection extends BreadcrumbsCollection implements DisableBreadcrumbsCollectionInterface | ||
{ | ||
/** | ||
* @inheritDoc | ||
*/ | ||
public function addDisableItem(string $text, string $url): DisableBreadcrumbsCollectionInterface { | ||
return $this->addDisableItemNamespace('default', $text, $url); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function addDisableRouteItem(string $text, string $route, array $parameters = []): DisableBreadcrumbsCollectionInterface { | ||
return $this->addDisableRouteItemNamespace('default', $text, $route, $parameters); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function addDisableItemNamespace(string $namespace, string $text, string $url): DisableBreadcrumbsCollectionInterface { | ||
return $this->addBreadcrumb(new UrlBreadcrumb($text, $url, true), $namespace); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function addDisableRouteItemNamespace(string $namespace, string $text, string $route, array $parameters = []): DisableBreadcrumbsCollectionInterface { | ||
$url = $this->urlGenerator->generate($route, $parameters); | ||
return $this->addDisableItemNamespace($namespace, $text, $url); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function prependDisableItem(string $text, string $url): DisableBreadcrumbsCollectionInterface { | ||
return $this->prependDisableItemNamespace('default', $text, $url); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function prependDisableRouteItem(string $text, string $route, array $parameters = []): DisableBreadcrumbsCollectionInterface { | ||
return $this->prependDisableRouteItemNamespace('default', $text, $route, $parameters); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function prependDisableItemNamespace(string $namespace, string $text, string $url): DisableBreadcrumbsCollectionInterface { | ||
return $this->prependBreadcrumb(new UrlBreadcrumb($text, $url, true), $namespace); | ||
} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public function prependDisableRouteItemNamespace(string $namespace, string $text, string $route, array $parameters = []): DisableBreadcrumbsCollectionInterface { | ||
$url = $this->urlGenerator->generate($route, $parameters); | ||
return $this->prependDisableItemNamespace($namespace, $text, $url); | ||
} | ||
|
||
} |
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,82 @@ | ||
<?php | ||
|
||
namespace Jugid\AutomaticBreadcrumbs\Collection; | ||
|
||
/** | ||
* @author Julien Gidel <gidjulien@gmail.com> | ||
*/ | ||
interface DisableBreadcrumbsCollectionInterface extends BreadcrumbsCollectionInterface | ||
{ | ||
/** | ||
* Add a BreadcrumbInterface object representing a future element to the default namespace. | ||
* @param string $text | ||
* @param string $url | ||
* @return DisableBreadcrumbsCollectionInterface | ||
*/ | ||
public function addDisableItem(string $text, string $url) : self; | ||
|
||
/** | ||
* Add a BreadcrumbInterface object representing a future element to the default namespace with the url generated | ||
* @param string $text | ||
* @param string $route | ||
* @param array $parameters | ||
* @return DisableBreadcrumbsCollectionInterface | ||
*/ | ||
public function addDisableRouteItem(string $text, string $route, array $parameters = []): self; | ||
|
||
/** | ||
* Add a BreadcrumbInterface object representing a future element to the specfied namespace | ||
* @param string $namespace | ||
* @param string $text | ||
* @param string $url | ||
* @return DisableBreadcrumbsCollectionInterface | ||
*/ | ||
public function addDisableItemNamespace(string $namespace, string $text, string $url) : self; | ||
|
||
/** | ||
* Add a BreadcrumbInterface object representing a future element to the specified namespace with the url generated | ||
* @param string $namespace | ||
* @param string $text | ||
* @param string $route | ||
* @param array $parameters | ||
* @return DisableBreadcrumbsCollectionInterface | ||
*/ | ||
public function addDisableRouteItemNamespace(string $namespace, string $text, string $route, array $parameters = []): self; | ||
|
||
/** | ||
* Prepend a BreadcrumbInterface object representing a future element to the namespace | ||
* @param string $text | ||
* @param string $url | ||
* @return DisableBreadcrumbsCollectionInterface | ||
*/ | ||
public function prependDisableItem(string $text, string $url) : self; | ||
|
||
/** | ||
* Prepend a BreadcrumbInterface object representing a future element to the default namespace with the url generated | ||
* @param string $text | ||
* @param string $route | ||
* @param array $parameters | ||
* @return DisableBreadcrumbsCollectionInterface | ||
*/ | ||
public function prependDisableRouteItem(string $text, string $route, array $parameters = []): self; | ||
|
||
/** | ||
* Prepend a BreadcrumbInterface object representing a future element to the specfied namespace | ||
* @param string $namespace | ||
* @param string $text | ||
* @param string $url | ||
* @return DisableBreadcrumbsCollectionInterface | ||
*/ | ||
public function prependDisableItemNamespace(string $namespace, string $text, string $url) : self; | ||
|
||
/** | ||
* Prepend a BreadcrumbInterface object to the specified namespace with the url generated representing a future element | ||
* @param string $namespace | ||
* @param string $text | ||
* @param string $route | ||
* @param array $parameters | ||
* @return DisableBreadcrumbsCollectionInterface | ||
*/ | ||
public function prependDisableRouteItemNamespace(string $namespace, string $text, string $route, array $parameters = []): self; | ||
|
||
} |
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
Oops, something went wrong.