public function createRowAction(Request $request)
    {
        $container = $this->findContainer(intval($request->attributes->get('containerId')));

        $target = is_null($container->getCopy()) ? $container : $container->getCopy();

        try {
            $row = $this->getEditor()->createDefaultRow([], $target);
        } catch (EditorExceptionInterface $e) {
            return $this->handleException($e);
        }

        $this->validate($target);
        $this->persist($target);

        $viewBuilder = $this->getViewBuilder();

        $data = [
            'created'    => $viewBuilder->buildRow($row)->getAttributes()->getId(),
            'containers' => [$viewBuilder->buildContainer($container)],
        ];

        return $this->buildResponse($data, self::SERIALIZE_FULL);
    }
public function createRowAction(Request $request)
    {
        $container = $this->findContainer(intval($request->attributes->get('containerId')));

        $target = is_null($container->getCopy()) ? $container : $container->getCopy();

        try {
            $row = $this->getEditor()->createDefaultRow([], $target);
        } catch (EditorExceptionInterface $e) {
            return $this->handleException($e);
        }

        $this->validate($target);
        $this->persist($target);

        $viewBuilder = $this->getViewBuilder();

        $data = [
            'created'    => $viewBuilder->buildRow($row)->getAttributes()->getId(),
            'containers' => [$viewBuilder->buildContainer($container)],
        ];

        return $this->buildResponse($data, self::SERIALIZE_FULL);
    }
public function createRowAction ( Request $ request ) { $ container = $ this -> findContainer ( intval ( $ request -> attributes -> get ( 'containerId' ) ) ) ; $ target = is_null ( $ container -> getCopy ( ) ) ? $ container : $ container -> getCopy ( ) ; try { $ row = $ this -> getEditor ( ) -> createDefaultRow ( [ ] , $ target ) ; } catch ( EditorExceptionInterface $ e ) { return $ this -> handleException ( $ e ) ; } $ this -> validate ( $ target ) ; $ this -> persist ( $ target ) ; $ viewBuilder = $ this -> getViewBuilder ( ) ; $ data = [ 'created' => $ viewBuilder -> buildRow ( $ row ) -> getAttributes ( ) -> getId ( ) , 'containers' => [ $ viewBuilder -> buildContainer ( $ container ) ] , ] ; return $ this -> buildResponse ( $ data , self :: SERIALIZE_FULL ) ; }
Create and append a new row to the container.

@param Request $request

@return Response
Create and append a new row to the container .