Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
50 changes: 36 additions & 14 deletions src/RouteMap/RouteMapAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ abstract class RouteMapAbstract extends DataIterator implements RouteMapInterfac
* @var ContainerInterface
*/
protected $container;
/**
* @var bool
*/
protected $deprecated = false;
/**
* @var string
*/
Expand Down Expand Up @@ -62,6 +66,16 @@ final public function __construct(ContainerInterface $container)
$this->initialize();
}

/**
* @inheritdoc
*/
public function deprecated()
{
$this->deprecated = true;

return $this;
}

/**
* @inheritdoc
*/
Expand All @@ -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) {
Expand Down Expand Up @@ -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
*
Expand Down