public function createObjectState($objectStateGroupId, Request $request)
    {
        $objectStateGroup = $this->objectStateService->loadObjectStateGroup($objectStateGroupId);

        try {
            $createdObjectState = $this->objectStateService->createObjectState(
                $objectStateGroup,
                $this->inputDispatcher->parse(
                    new Message(
                        array('Content-Type' => $request->headers->get('Content-Type')),
                        $request->getContent()
                    )
                )
            );
        } catch (InvalidArgumentException $e) {
            throw new ForbiddenException($e->getMessage());
        }

        return new Values\CreatedObjectState(
            array(
                'objectState' => new RestObjectState(
                    $createdObjectState,
                    $objectStateGroup->id
                ),
            )
        );
    }
public function createObjectState($objectStateGroupId, Request $request)
    {
        $objectStateGroup = $this->objectStateService->loadObjectStateGroup($objectStateGroupId);

        try {
            $createdObjectState = $this->objectStateService->createObjectState(
                $objectStateGroup,
                $this->inputDispatcher->parse(
                    new Message(
                        array('Content-Type' => $request->headers->get('Content-Type')),
                        $request->getContent()
                    )
                )
            );
        } catch (InvalidArgumentException $e) {
            throw new ForbiddenException($e->getMessage());
        }

        return new Values\CreatedObjectState(
            array(
                'objectState' => new RestObjectState(
                    $createdObjectState,
                    $objectStateGroup->id
                ),
            )
        );
    }
public function createObjectState ( $ objectStateGroupId , Request $ request ) { $ objectStateGroup = $ this -> objectStateService -> loadObjectStateGroup ( $ objectStateGroupId ) ; try { $ createdObjectState = $ this -> objectStateService -> createObjectState ( $ objectStateGroup , $ this -> inputDispatcher -> parse ( new Message ( array ( 'Content-Type' => $ request -> headers -> get ( 'Content-Type' ) ) , $ request -> getContent ( ) ) ) ) ; } catch ( InvalidArgumentException $ e ) { throw new ForbiddenException ( $ e -> getMessage ( ) ) ; } return new Values \ CreatedObjectState ( array ( 'objectState' => new RestObjectState ( $ createdObjectState , $ objectStateGroup -> id ) , ) ) ; }
Creates a new object state.

@param $objectStateGroupId

@throws \eZ\Publish\Core\REST\Server\Exceptions\ForbiddenException

@return \eZ\Publish\Core\REST\Server\Values\CreatedObjectState
Creates a new object state .