Class

eZ\Bundle\EzPublishCoreBundle\Features\Context\BasicContentContext

class BasicContentContext implements Context

Sentences for simple Contents creation.

Constants

DEFAULT_LANGUAGE

Default language.

Methods

__construct(Repository $repository, ContentTypeService $contentTypeService, ContentService $contentService)

mixed createContent(string $contentType, array $fields, mixed $parentLocationId)

Creates and publishes a Content.

publishDraft(Content $content)

Publishes a content draft.

Content createContentDraft($parentLocationId, $contentTypeIdentifier, $fields, $languageCode = null)

Creates a content draft.

mixed createContentWithPath(string $path, array $fields, mixed $contentType)

Creates and publishes a content at a given path.

getContentPath($name)

Getter for contentPaths.

createBasicFolder($path)

createBasicArticle($path)

createArticleDraft($path)

Details

at line 46
public __construct(Repository $repository, ContentTypeService $contentTypeService, ContentService $contentService)

Parameters

Repository $repository
ContentTypeService $contentTypeService
ContentService $contentService

at line 65
public mixed createContent(string $contentType, array $fields, mixed $parentLocationId)

Creates and publishes a Content.

Parameters

string $contentType
array $fields
mixed $parentLocationId

Return Value

mixed The content's main location id

at line 80
public publishDraft(Content $content)

Publishes a content draft.

Parameters

Content $content

at line 95
public Content createContentDraft($parentLocationId, $contentTypeIdentifier, $fields, $languageCode = null)

Creates a content draft.

Parameters

$parentLocationId
$contentTypeIdentifier
$fields
$languageCode

Return Value

Content an unpublished Content draft

at line 119
public mixed createContentWithPath(string $path, array $fields, mixed $contentType)

Creates and publishes a content at a given path.

Non-existing path items are created as folders named after the path element.

Parameters

string $path The content path
array $fields
mixed $contentType The content type identifier

Return Value

mixed location id of the created content

at line 142
public getContentPath($name)

Getter for contentPaths.

Parameters

$name

at line 159
public createBasicFolder($path)

Parameters

$path

at line 169
public createBasicArticle($path)

Parameters

$path

at line 182
public createArticleDraft($path)

Parameters

$path