Skip to content

Commit a44925a

Browse files
committed
deprecate routeContent and use content instead. fix #118
1 parent f49707f commit a44925a

File tree

5 files changed

+31
-8
lines changed

5 files changed

+31
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Changelog
22
=========
33

4+
* **2013-07-26**: [Model] Deprecated setRouteContent and getRouteContent, use setContent and getContent instead.
45
* **2013-07-19**: [Model] Separated database agnostic, doctrine generic and
56
PHPCR-ODM specific code to prepare for Doctrine ORM support.
67
* **2013-07-17**: [FormType] Moved TermsFormType to CoreBundle and renamed it to CheckboxUrlLableFormType

Model/RedirectRoute.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ class RedirectRoute extends Route implements RedirectRouteInterface
4545
*
4646
* @throws LogicException
4747
*/
48-
public function setRouteContent($document)
48+
public function setContent($document)
4949
{
5050
throw new LogicException('Do not set a content for the redirect route. It is its own content.');
5151
}
5252

5353
/**
5454
* {@inheritDoc}
5555
*/
56-
public function getRouteContent()
56+
public function getContent()
5757
{
5858
return $this;
5959
}

Model/Route.php

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Route extends SymfonyRoute implements RouteObjectInterface
2525
*
2626
* @var object
2727
*/
28-
protected $routeContent;
28+
protected $content;
2929

3030
/**
3131
* Part of the URL that does not have parameters and thus can be used to
@@ -116,11 +116,22 @@ public function setStaticPrefix($prefix)
116116
}
117117

118118
/**
119-
* Set the object this url points to
119+
* @deprecated use setContent instead
120120
*/
121121
public function setRouteContent($object)
122122
{
123-
$this->routeContent = $object;
123+
$this->setContent($object);
124+
}
125+
126+
/**
127+
* Set the object this url points to
128+
*
129+
* @param mixed $object A content object that can be persisted by the
130+
* storage layer.
131+
*/
132+
public function setContent($object)
133+
{
134+
$this->content = $object;
124135

125136
return $this;
126137
}
@@ -130,7 +141,15 @@ public function setRouteContent($object)
130141
*/
131142
public function getRouteContent()
132143
{
133-
return $this->routeContent;
144+
return $this->getContent();
145+
}
146+
147+
/**
148+
* {@inheritDoc}
149+
*/
150+
public function getContent()
151+
{
152+
return $this->content;
134153
}
135154

136155
/**

Resources/config/doctrine-model/Route.phpcr.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<mapped-superclass name="Symfony\Cmf\Bundle\RoutingBundle\Model\Route" referenceable="true">
1010
<field name="variablePattern" type="string"/>
1111
<field name="addFormatPattern" type="boolean"/>
12-
<reference-one name="routeContent"/>
12+
<reference-one name="content" property="routeContent"/>
1313
</mapped-superclass>
1414

1515
</doctrine-mapping>

UPGRADE-1.1.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,7 @@ PHPCR specific configurations moved into
1616

1717
You need to at least set `phpcr_provider: ~` to have the PHPCR provider loaded.
1818

19-
Dropped redundant unused `routing_repositoryroot` configuration.
19+
Dropped redundant unused `routing_repositoryroot` configuration.
20+
21+
Deprecated the setRouteContent and getRouteContent methods. Use setContent and
22+
getContent instead.

0 commit comments

Comments
 (0)