Rest/Content/Content.php
private function prepareFields(ApiContentType $contentType, $fields = null)
    {
        if ($fields !== null) {
            if (strpos($fields, ',') !== false) {
                return explode(',', $fields);
            }

            return array($fields);
        }

        $fields = array();
        $contentFields = $contentType->getFieldDefinitions();

        foreach ($contentFields as $field) {
            $fields[] = $field->identifier;
        }

        return $fields;
    }
private function prepareFields(ApiContentType $contentType, $fields = null)
    {
        if ($fields !== null) {
            if (strpos($fields, ',') !== false) {
                return explode(',', $fields);
            }

            return array($fields);
        }

        $fields = array();
        $contentFields = $contentType->getFieldDefinitions();

        foreach ($contentFields as $field) {
            $fields[] = $field->identifier;
        }

        return $fields;
    }
private function prepareFields ( ApiContentType $ contentType , $ fields = null ) { if ( $ fields !== null ) { if ( strpos ( $ fields , ',' ) !== false ) { return explode ( ',' , $ fields ) ; } return array ( $ fields ) ; } $ fields = array ( ) ; $ contentFields = $ contentType -> getFieldDefinitions ( ) ; foreach ( $ contentFields as $ field ) { $ fields [ ] = $ field -> identifier ; } return $ fields ; }
Checks if fields are given, if not - returns all of them.

@param \eZ\Publish\API\Repository\Values\ContentType\ContentType $contentType
@param string $fields

@return array|null
Checks if fields are given if not - returns all of them .