1 | <?php |
||
21 | final class VersionBuilder |
||
22 | { |
||
23 | /** @var array */ |
||
24 | private $targetVersionProperties = []; |
||
25 | |||
26 | public function build(): Target\Version |
||
30 | |||
31 | /** |
||
32 | * Set intent to translate, to an unspecified (yet) language, any from the given list. |
||
33 | * |
||
34 | * @param array $languageCodes |
||
35 | * |
||
36 | * @return self |
||
37 | * |
||
38 | * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
||
39 | */ |
||
40 | public function translateToAnyLanguageOf(array $languageCodes): self |
||
52 | |||
53 | /** |
||
54 | * Set intent to create Content from unspecified (yet) content type, any from the given list. |
||
55 | * |
||
56 | * @param int[] $contentTypeIds |
||
57 | * |
||
58 | * @return self |
||
59 | * |
||
60 | * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
||
61 | */ |
||
62 | public function createFromAnyContentTypeOf(array $contentTypeIds): self |
||
74 | |||
75 | /** |
||
76 | * Set intent to change Version status. |
||
77 | * |
||
78 | * Supported: <code>VersionInfo::STATUS_DRAFT, VersionInfo::STATUS_PUBLISHED, VersionInfo::STATUS_ARCHIVED</code> |
||
79 | * |
||
80 | * @see \eZ\Publish\API\Repository\Values\Content\VersionInfo |
||
81 | * |
||
82 | * @param int $status |
||
83 | * |
||
84 | * @return self |
||
85 | * |
||
86 | * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
||
87 | */ |
||
88 | public function changeStatusTo(int $status): self |
||
104 | |||
105 | /** |
||
106 | * Set intent to update Content Version Fields. |
||
107 | * |
||
108 | * @param string|null $initialLanguageCode |
||
109 | * @param \eZ\Publish\API\Repository\Values\Content\Field[] $fields |
||
110 | * |
||
111 | * @return self |
||
112 | */ |
||
113 | public function updateFieldsTo(?string $initialLanguageCode, array $fields): self |
||
129 | |||
130 | /** |
||
131 | * Set intent to publish, to specified translations, all from the given list. |
||
132 | * |
||
133 | * @param array $languageCodes |
||
134 | * |
||
135 | * @return self |
||
136 | * |
||
137 | * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException |
||
138 | */ |
||
139 | public function publishTranslations(array $languageCodes): self |
||
151 | } |
||
152 |