diff --git a/composer.json b/composer.json index 72195ee..17a80a3 100644 --- a/composer.json +++ b/composer.json @@ -21,9 +21,9 @@ }, "require": { "propel/propel": "~2.0@dev", - "wollanup/php-api-rest-interfaces": "1.1.7", + "wollanup/php-api-rest-interfaces": "^1.1.9", "wollanup/php-api-rest-propel-behavior": "^1.1", - "wollanup/php-api-rest-service-request": "^1.0", + "wollanup/php-api-rest-service-request": "^1.0.1", "wollanup/php-api-rest-utils": "^1.1", "crell/api-problem": "^2.0", "akrabat/rka-content-type-renderer": "^0.7.3" diff --git a/src/RouteMap/RouteMapAbstract.php b/src/RouteMap/RouteMapAbstract.php index 05d7c45..21e78e1 100644 --- a/src/RouteMap/RouteMapAbstract.php +++ b/src/RouteMap/RouteMapAbstract.php @@ -34,6 +34,10 @@ abstract class RouteMapAbstract extends DataIterator implements RouteMapInterfac * @var ContainerInterface */ protected $container; + /** + * @var bool + */ + protected $deprecated = false; /** * @var string */ @@ -62,6 +66,16 @@ final public function __construct(ContainerInterface $container) $this->initialize(); } + /** + * @inheritdoc + */ + public function deprecated() + { + $this->deprecated = true; + + return $this; + } + /** * @inheritdoc */ @@ -86,6 +100,28 @@ public function getPackage() return ($this->isSubResourceOfPackage()) ? $this->packageName : $this->resourceName; } + /** + * @return string + */ + public function getResource() + { + return $this->resourceName; + } + + public function hasPackage() + { + return null !== $this->packageName; + } + + public function isSubResourceOfPackage() + { + if (!$this->hasPackage()) { + return false; + } + + return $this->resourceName !== $this->packageName; + } + final public function registerRoutes(RouterInterface $router) { foreach ($this->data as $Route) { @@ -199,20 +235,6 @@ final protected function put($pattern) return $this->add(Route::PUT, $pattern); } - private function hasPackage() - { - return null !== $this->packageName; - } - - private function isSubResourceOfPackage() - { - if (!$this->hasPackage()) { - return false; - } - - return $this->resourceName !== $this->packageName; - } - /** * @param $routeName *