-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #219 from EmmanuelVella/child-interface
Use child interface
- Loading branch information
Showing
4 changed files
with
50 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
use Doctrine\Common\Collections\Collection; | ||
use Doctrine\ODM\PHPCR\Document\Generic; | ||
use Doctrine\ODM\PHPCR\Exception\InvalidArgumentException; | ||
use Symfony\Cmf\Bundle\CoreBundle\Model\ChildInterface; | ||
use Symfony\Cmf\Component\Routing\RouteObjectInterface; | ||
use Symfony\Cmf\Bundle\RoutingBundle\Model\Route as RouteModel; | ||
|
||
|
@@ -24,7 +25,7 @@ | |
* | ||
* @author [email protected] | ||
*/ | ||
class Route extends RouteModel implements PrefixInterface | ||
class Route extends RouteModel implements PrefixInterface, ChildInterface | ||
{ | ||
/** | ||
* parent document | ||
|
@@ -88,14 +89,32 @@ public function setAddTrailingSlash($addTrailingSlash) | |
$this->addTrailingSlash = $addTrailingSlash; | ||
} | ||
|
||
/** | ||
* @deprecated Use setParentDocument instead. | ||
*/ | ||
public function setParent($parent) | ||
{ | ||
$this->parent = $parent; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @deprecated Use getParentDocument instead. | ||
*/ | ||
public function getParent() | ||
{ | ||
return $this->parent; | ||
} | ||
|
||
/** | ||
* Move the route by setting a parent. | ||
* | ||
* Note that this will change the URL this route matches. | ||
* | ||
* @param object $parent the new parent document | ||
*/ | ||
public function setParent($parent) | ||
public function setParentDocument($parent) | ||
{ | ||
if (!is_object($parent)) { | ||
throw new InvalidArgumentException("Parent must be an object ".gettype ($parent)." given."); | ||
|
@@ -112,7 +131,7 @@ public function setParent($parent) | |
* | ||
* @return Generic object | ||
*/ | ||
public function getParent() | ||
public function getParentDocument() | ||
{ | ||
return $this->parent; | ||
} | ||
|
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