public function postAction($type, Request $request)
    {
        $classname = AbstractClassContent::getClassnameByContentType($type);
        $content = new $classname();
        $this->granted('CREATE', $content);

        $this->getEntityManager()->persist($content);
        $content->setDraft($this->getClassContentManager()->getDraft($content, true));

        $this->getEntityManager()->flush();

        $data = $request->request->all();
        if (0 < count($data)) {
            $data = array_merge($data, [
                'type' => $type,
                'uid'  => $content->getUid(),
            ]);

            $this->updateClassContent($type, $data['uid'], $data);
            $this->getEntityManager()->flush();
        }

        return $this->createJsonResponse(null, 201, [
            'BB-RESOURCE-UID' => $content->getUid(),
            'Location'        => $this->getApplication()->getRouting()->getUrlByRouteName(
                'bb.rest.classcontent.get',
                [
                    'version' => $request->attributes->get('version'),
                    'type'    => $type,
                    'uid'     => $content->getUid(),
                ],
                '',
                false
            ),
        ]);
    }