|
@@ -147,6 +147,8 @@ class ONURESTController extends RESTController
|
|
|
*/
|
|
|
public function applyAction(Request $request, ONU $entity, String $workflow, String $transition)
|
|
|
{
|
|
|
+ $entity->setAdministrativeState("suspend");
|
|
|
+ return $entity;
|
|
|
try {
|
|
|
|
|
|
$wr = $this->container->get("workflow.registry");
|
|
@@ -154,6 +156,7 @@ class ONURESTController extends RESTController
|
|
|
|
|
|
$newState = $wf->apply($entity, $transition);
|
|
|
|
|
|
+
|
|
|
$em = $this->container->get("doctrine.orm.entity_manager");
|
|
|
$validator = $this->container->get('validator');
|
|
|
$errors = $validator->validate($entity);
|
|
@@ -161,8 +164,10 @@ class ONURESTController extends RESTController
|
|
|
$errorsString = (string) $errors;
|
|
|
return FOSView::create($errorsString, Codes::HTTP_INTERNAL_SERVER_ERROR);
|
|
|
}else{
|
|
|
+ $entity->setAdministrativeState("suspend");
|
|
|
$em->persist($entity);
|
|
|
$em->flush();
|
|
|
+ $em->getConnection()->commit();
|
|
|
|
|
|
return $entity;
|
|
|
}
|