Skip to content

Commit 3f98be7

Browse files
authored
Merge pull request #26 from wollanup/develop
update version of wollanup/php-api-rest-interfaces
2 parents f8e1b3d + 21bb47a commit 3f98be7

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"require": {
2323
"propel/propel": "~2.0@dev",
24-
"wollanup/php-api-rest-interfaces": "^1.1.5",
24+
"wollanup/php-api-rest-interfaces": "1.1.7",
2525
"wollanup/php-api-rest-propel-behavior": "^1.1",
2626
"wollanup/php-api-rest-service-request": "^1.0",
2727
"wollanup/php-api-rest-utils": "^1.1",

src/Service/Router/Route.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function bindToRouter(RouterInterface $router)
9595
$this->callable = sprintf('%s:%s', $this->getActionClass(), $this->getActionMethod());
9696
if ($this->isMakeInstance()) {
9797
$route = $this;
98-
if ($this->getVerb() === Route::POST && !$this->instanceForceFetch) {
98+
if ($this->isMakeInstanceCreate()) {
9999
# POST : create
100100
$this->add(function ($request, $response, $next) use ($route) {
101101
$requestClass = $route->getRequestClass();
@@ -342,6 +342,22 @@ public function isMakeInstance()
342342
return $this->instanceFromPk;
343343
}
344344

345+
/**
346+
* @return bool
347+
*/
348+
public function isMakeInstanceCreate()
349+
{
350+
return $this->getVerb() === Route::POST && !$this->instanceForceFetch;
351+
}
352+
353+
/**
354+
* @return bool
355+
*/
356+
public function isMakeInstanceFetch()
357+
{
358+
return !$this->isMakeInstanceCreate();
359+
}
360+
345361
/**
346362
* @param bool $forceFetch
347363
*

0 commit comments

Comments
 (0)