Skip to content

Commit

Permalink
#114. Fix relations uri {id} generation
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurkushman committed Nov 3, 2018
1 parent eb4c3d6 commit 3745912
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/blocks/RoutesTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function setRoute(string $method, string $uri, string $endPoint) : void
*/
private function composeRelationsUri() : string
{
return $this->composeBaseUri() . PhpInterface::SLASH . RamlInterface::RAML_RELATIONSHIPS
return $this->composeRelationsBaseUri() . PhpInterface::SLASH . RamlInterface::RAML_RELATIONSHIPS
. PhpInterface::SLASH . PhpInterface::OPEN_BRACE
. ModelsInterface::MODEL_METHOD_RELATIONS . PhpInterface::CLOSE_BRACE . PhpInterface::QUOTES;
}
Expand Down Expand Up @@ -114,6 +114,7 @@ private function composeObjectUri() : string
}

/**
* Creates base uri
*
* @return string
*/
Expand All @@ -122,6 +123,17 @@ private function composeBaseUri() : string
return PhpInterface::QUOTES . PhpInterface::SLASH . strtolower($this->generator->objectName);
}

/**
* Creates base uri for relations
* @return string
*/
private function composeRelationsBaseUri() : string
{
return PhpInterface::QUOTES . PhpInterface::SLASH . strtolower($this->generator->objectName) .
PhpInterface::SLASH . PhpInterface::OPEN_BRACE
. RamlInterface::RAML_ID . PhpInterface::CLOSE_BRACE;
}

/**
* Creates controller@method end-point
*
Expand Down

0 comments on commit 3745912

Please sign in to comment.