File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff 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 *
You can’t perform that action at this time.
0 commit comments