NavigationItem: Provide a more sophisticated conflict detection
refs #5600
This commit is contained in:
parent
0feaec7af1
commit
bf2cb9ab7e
|
@ -596,11 +596,15 @@ class NavigationItem implements IteratorAggregate
|
||||||
*/
|
*/
|
||||||
public function conflictsWith(NavigationItem $item)
|
public function conflictsWith(NavigationItem $item)
|
||||||
{
|
{
|
||||||
|
if (! $item instanceof $this) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->getUrl() === null || $item->getUrl() === null) {
|
if ($this->getUrl() === null || $item->getUrl() === null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->getUrl() !== $item->getUrl();
|
return !$this->getUrl()->matches($item->getUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue