public function setupContenttype(Entity\Entity $entity)
    {
        $contentType = $entity->getContenttype();
        if (is_string($contentType)) {
            $contentTypeData = $this->app['storage']->getContenttype($contentType);
            if ($contentTypeData instanceof ContentType) {
                $contentTypeObject = $contentTypeData;
            } else {
                $contentTypeObject = new ContentType($contentType, $contentTypeData);
            }
            $entity->contenttype = $contentTypeObject;
        }
    }