19declare(strict_types=1);
66 foreach ($this->content_assembler->get($set, $request) as $type => $entity) {
67 if ($type === ContentType::FORM) {
73 if (!$form?->getData()) {
76 $data = $form->getData();
82 $this->copyright_handler->isCPSelectionActive() &&
88 $this->manipulator->execute($set);
96 foreach (
$data as $post_key => $value) {
98 $set = $this->prepareKeywords($set, $value);
101 $path = $this->path_factory->fromString($post_key);
102 if ($value ===
null || $value ===
'') {
103 $set = $this->manipulator->prepareDelete($set,
$path);
106 $set = $this->manipulator->prepareCreateOrUpdate($set,
$path, $value);
118 $keyword_els = $this->navigator_factory->navigator(
119 $path = $this->path_collection->keywords(),
121 )->elementsAtFinalStep();
122 $number_of_keywords = count(iterator_to_array($keyword_els));
124 if (!empty($values)) {
125 $set = $this->manipulator->prepareCreateOrUpdate($set,
$path, ...$values);
127 if (count($values) < $number_of_keywords) {
128 $delete_path = $this->path_collection->keywordsBetweenIndices(
130 $number_of_keywords - 1
132 $set = $this->manipulator->prepareDelete($set, $delete_path);
142 $type_source = $this->vocabulary_adapter->sourceMapForSlot(SlotIdentifier::EDUCATIONAL_LEARNING_RESOURCE_TYPE)($type_value);
143 if ($type_value ===
null || $type_value ===
'') {
144 $set = $this->manipulator->prepareDelete($set, $this->path_collection->firstLearningResourceType());
146 $set = $this->manipulator->prepareCreateOrUpdate(
148 $this->path_collection->firstLearningResourceType(),
152 if ($type_source ===
null || $type_source ===
'') {
153 $set = $this->manipulator->prepareDelete($set, $this->path_collection->firstLearningResourceTypeSource());
155 $set = $this->manipulator->prepareCreateOrUpdate(
157 $this->path_collection->firstLearningResourceTypeSource(),
162 $discipline =
$data[ContentAssembler::DISCIPLINE] ??
'';
163 if ($discipline ===
null || $discipline ===
'') {
164 $set = $this->manipulator->prepareDelete($set, $this->path_collection->firstDiscipline());
166 $set = $this->manipulator->prepareCreateOrUpdate(
168 $this->path_collection->firstDiscipline(),
186 foreach (
$data as $post_key => $value) {
187 $path = $paths[$post_key];
188 if ($value ===
null || $value ===
'') {
189 $set = $this->manipulator->prepareDelete($set,
$path);
192 $set = $this->manipulator->prepareCreateOrUpdate($set,
$path, $value);
201 $description =
$data[0];
202 if ($description === ContentAssembler::CUSTOM_CP) {
203 $description =
$data[1][ContentAssembler::CUSTOM_CP_DESCRIPTION];
206 if ($description ===
'' || $description ===
null) {
207 $set = $this->manipulator->prepareCreateOrUpdate(
209 $this->path_collection->hasCopyright(),
212 $set = $this->manipulator->prepareCreateOrUpdate(
214 $this->path_collection->sourceForHasCopyright(),
215 FactoryInterface::STANDARD_SOURCE
217 return $this->manipulator->prepareDelete($set, $this->path_collection->copyright());
220 $set = $this->manipulator->prepareCreateOrUpdate(
222 $this->path_collection->hasCopyright(),
225 $set = $this->manipulator->prepareCreateOrUpdate(
227 $this->path_collection->sourceForHasCopyright(),
228 FactoryInterface::STANDARD_SOURCE
230 $set = $this->manipulator->prepareCreateOrUpdate(
232 $this->path_collection->copyright(),
237 $this->copyright_handler->isObjectTypeHarvested($set->
getRessourceID()->type()) &&
238 isset(
$data[1][ContentAssembler::OER_BLOCKED])
240 $this->copyright_handler->setOerHarvesterBlocked(
242 (
bool)
$data[1][ContentAssembler::OER_BLOCKED]
const string GENERAL
POST VARS.
const string CLASSIFICATION