@param null $contentTypeName

@return Record[]
@throws AnyContentClientException
965401
protected function getAllMultiViewRecords($contentTypeName = null, DataDimensions $dataDimensions)
    {

        $data = $this->readRecords($this->getConfiguration()->getUriRecords($contentTypeName));

        if ($data)
        {
            $data = json_decode($data, true);

            $data['records'] = array_filter($data['records']);

            $definition = $this->getContentTypeDefinition($contentTypeName);

            $records = $this->getRecordFactory()
                            ->createRecordsFromJSONRecordsArray($definition, $data['records']);

            return $records;
        }

        return [ ];

    }
856410
public function actionTypeTemplate($schemaName = null)
    {
        if ($schemaName === null) {
            $schemaName = 'public';
        }
        return [
            'exists' => (new Query())
                ->select('typname')
                ->from('pg_type')
                ->where('typname=:value', [':value' => 'action_type'])->exists($this->db),
            'up' => "CREATE TYPE $schemaName.action_type AS ENUM ('INSERT', 'SELECT', 'UPDATE', 'DELETE', 'TRUNCATE')",
            'down' => "DROP TYPE $schemaName.action_type",
        ];
    }
839019
private function doGetCollectionByContent($contentType, $contentUid)
    {
        $content = null;
        $classname = AbstractClassContent::getClassnameByContentType($contentType);
        $em = $this->getApplication()->getEntityManager();

        try {
            $content = $em->find($classname, $contentUid);
        } catch (ClassNotFoundException $e) {
            throw new NotFoundHttpException("No classcontent found with provided type (:$contentType)");
        }

        if (null === $content) {
            throw new NotFoundHttpException("No `$classname` exists with uid `$contentUid`");
        }

        $pages = $em->getRepository("BackBee\ClassContent\AbstractClassContent")->findPagesByContent($content);

        $response = $this->createResponse($this->formatCollection($pages));
        if (0 < count($pages)) {
            $response->headers->set('Content-Range', '0-'.(count($pages) - 1).'/'.count($pages));
        }

        return $response;
    }
1035899
protected function getConfigForContentType(ContentType $contentType)
    {
        if ($this->hasConfigForContentType($contentType)) {
            return $this->config['override_by_type'][$contentType->identifier];
        }

        return [];
    }
930755
public function decode(string $data, string $contentType): array
    {
        if (isset($this->decoderTypes[$contentType])) {
            return $this->decoderTypes[$contentType]->decode($data);
        }

        throw DeserializerLogicException::createMissingContentType($contentType);
    }
214149
public function getFieldGroupValuesForContent(ContentInterface $content = null, $slug)
    {
        if (null === $content) {
            return [];
        }

        foreach ($content->getFieldValues() as $fieldValue) {
            if ($fieldValue->getField()->getSlug() == $slug) {
                return $fieldValue->getChildren();
            }
        }
        return [];
    }
864645
protected function getContent($contentTypeSlug, array $contentParameters, ListingOptions $options)
    {
        $contentParameters = array_filter($contentParameters);
        $records = $this->query->getContent($contentTypeSlug, $contentParameters);
        if ($records === null && $options->getPage() !== null) {
            $contentParameters['page'] = $options->getPreviousPage();
            $records = $this->query->getContent($contentTypeSlug, $contentParameters);
        }
        $this->runPagerQueries($records);
        if ($options->getGroupSort() && !$options->getOrder()) {
            $records = $this->runGroupSort($records);
        }

        return $records;
    }
942447
public static function create($content = null, $contentType = 'text/plain')
    {
        $instance = new static();

        $instance->content = $content;
        $instance->contentType = $contentType;

        return $instance;
    }
861447
public function getAllRecords($contentTypeName = null, DataDimensions $dataDimensions = null)
    {
        if ($contentTypeName == null) {
            $contentTypeName = $this->getCurrentContentTypeName();
        }

        if ($dataDimensions == null) {
            $dataDimensions = $this->getCurrentDataDimensions();
        }

        $tableName = $this->getContentTypeTableName($contentTypeName);

        $sql = 'SELECT * FROM ' . $tableName . ' WHERE workspace = ? AND language = ? AND deleted = 0 AND validfrom_timestamp <= ? AND validuntil_timestamp > ?';

        $timestamp = TimeShifter::getTimeshiftTimestamp($dataDimensions->getTimeShift());

        $rows = $this->getDatabase()
                     ->fetchAllSQL($sql, [$dataDimensions->getWorkspace(), $dataDimensions->getLanguage(), $timestamp, $timestamp]);

        $records = [];
        foreach ($rows as $row) {
            $records[$row['id']] = $this->createRecordFromRow($row, $contentTypeName, $dataDimensions);
        }

        return $records;
    }
1265855
public function selectContentType($contentTypeName)
    {
        $definition = $this->getContentTypeDefinition($contentTypeName);

        $this->currentContentTypeDefinition = $definition;
        $this->currentContentTypeName       = $definition->getName();

        return $this;
    }
993771
public function copyContentType($contentTypeId)
    {
        $copiedContentType = $this->contentTypeService->copyContentType(
            $this->contentTypeService->loadContentType($contentTypeId)
        );

        return new Values\ResourceCreated(
            $this->router->generate(
                'ezpublish_rest_loadContentType',
                array('contentTypeId' => $copiedContentType->id)
            )
        );
    }
98638
public function getOrderedFields(ContentTypeInterface $contentType)
    {
        return $this->om->getRepository($this->configurationManager->getEntityClass('field'))
            ->findBy(['contentType' => $contentType], ['sortOrder' => 'ASC']);
    }
48623
public function getListingData(array $contenttype, $contentId, array $queryOptions)
    {
        // We have a content type, and possibly a content ID.
        $content = null;

        if ($contentId) {
            $content = $this->app['storage']->getContent($contenttype['slug'], ['id' => $contentId, 'hydrate' => false]);
            $queryOptions['contentid'] = $contentId;
        }

        // Getting a slice of data and the total count
        $logEntries = $this->changeRepository->getChangeLogByContentType($contenttype['slug'], $queryOptions);
        $itemCount = $this->changeRepository->countChangeLogByContentType($contenttype['slug'], $queryOptions);

        // The page title we're sending to the template depends on a few things:
        // If no contentid is given, we'll use the plural form of the content
        // type; otherwise, we'll derive it from the changelog or content item
        // itself.
        if ($contentId) {
            if ($content) {
                // content item is available: get the current title
                $title = $content->getTitle();
            } else {
                // content item does not exist (anymore).
                if (empty($logEntries)) {
                    // No item, no entries - phew. Content type name and ID
                    // will have to do.
                    $title = $contenttype['singular_name'] . ' #' . $contentId;
                } else {
                    // No item, but we can use the most recent title.
                    $title = $logEntries[0]['title'];
                }
            }
        } else {
            // We're displaying all changes for the entire content type,
            // so the plural name is most appropriate.
            $title = $contenttype['name'];
        }

        return ['content' => $content, 'title' => $title, 'entries' => $logEntries, 'count' => $itemCount];
    }
66630
public function getRevisionsOfConfig($configTypeName)
    {
        if (!$this->readConnection instanceof RevisionConnection) {
            throw new AnyContentClientException ('Current connection doesn\'t support revision operations.');
        }

        $dataDimensions = $this->getCurrentDataDimensions();

        return $this->readConnection->getRevisionsOfConfig($configTypeName, $dataDimensions);
    }
1059923
private function getContentTypesNumbers(array $contentTypes): array
    {
        $contentTypesNumbers = array_column($contentTypes, 'id');

        return array_combine($contentTypesNumbers, array_fill_keys($contentTypesNumbers, false));
    }
1047824
public function listContentTypesForGroup($contentTypeGroupId, Request $request)
    {
        $contentTypes = $this->contentTypeService->loadContentTypes(
            $this->contentTypeService->loadContentTypeGroup($contentTypeGroupId, Language::ALL),
            Language::ALL
        );

        if ($this->getMediaType($request) === 'application/vnd.ez.api.contenttypelist') {
            return new Values\ContentTypeList($contentTypes, $request->getPathInfo());
        }

        return new Values\ContentTypeInfoList($contentTypes, $request->getPathInfo());
    }
774901
protected function parseContentType($contentType) {
        $parts = explode(';', $contentType);

        foreach ($parts as $key => $value) {
            $parts[$key] = trim($value);
        }

        return $parts;
    }